@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1702144560 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 9.95e-4, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1702144560
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 9.95e-4, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0x529A18E2C53B2F78EBFADA7893E671C3C6E5D6061EEF5DE9B5975ABC5CA8B94A,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0xf069dfc4bf2911370d442617e7862572a87ce454", data: "0x#{abi_data}"]
request = [jsonrpc: "2.0", id: "1", method: "eth_call", params: [tx, "latest"]]
headers = ["Content-Type": "application/json"]
body = Json.to_string(request)
res = Http.request("https://data-seed-prebsc-1-s2.bnbchain.org:8545", "POST", headers, body)
if res.status == 200 && Json.is_valid?(res.body) do
response = Json.parse(res.body)
result = Map.get(response, "result")
if result != nil do
decoded_abi = Evm.abi_decode("(uint)", result)
# Withdrawn status is 1
valid? = List.at(decoded_abi, 0) == 1
end
end
valid?
)
]
actions triggered_by: transaction, on: reveal_secret(secret) do
Contract.set_type "transfer"
Contract.add_token_transfer to: 0x000066062AE51C8EDDB115B895B4917CF9A25F20A0CDAEEDCFC62085AB197F6B48FC, amount: 9.9202e-4, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.98e-6, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
17AC6C7A42AA93BB9EB25D23E546AB2555B68469A041C3D1E63C034792A88B0113B77A286769A70EDB216ED16150DFD0AA19E8C4FC084A5E18047910
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00004E8F...9C8EAt 2023-12-09 15:57:31 UTCAmount 0.35621083 UCO
-
From 0000CEB9...3C6EAt 2023-12-09 15:57:25 UTCAmount 0.000995 0000288B...B827
Previous public key
00018E06C9BF77BFDE38D0352197110BE4CE3A7386F64899679202C2917F39FF2F53
Previous signature
2F98A3337E9E6579C76C8579AB0F946D9F05C7AABFD01B3800BA2BCE99C017D7AA4456399FB807ED945267EA409B38591A813A698E10E0A1B814D0DAE24CC006
Origin signature
304502201E84A5ADAE321D618D9C65BD65C730ABC3EAC3124C13B991FCBB2C3305B9066302210099F7EC31A8EC3ABE1F07D68D7359DE2FE4344B284CA1DB4F3BCF9A6E520EBD7D
Proof of work
010204892A04DBE05192BCB662689E7E19700F3F7202028EF0A9F20635C4948436ED85A43BA3017281EE97781342DD8F24ED6F583B5FE542830FDB5191A11843A72A61
Proof of integrity
0057A7CE78D9F8AA6E037296FC115ADAFB333287D3D191F8ACE90193F2B682F452
Coordinator signature
1D2637B327F33281994B3C69143AF341EA8A6113482DAD9A2FD7EDA50E8FCEC5DC645A9EB86CFE468067CEF4065E0CD10A66290BADD651CCD621B0E557D63A06
Validator #1 public key
000151C124A6211CD402FD1CFE560C5DB51ED0CBEF44B09B21A41206028E7E5942BF
Validator #1 signature
0489D8E9627B84D4511730D28F87E8D5C67E64C35EBBC67C826AA9D4DA52DD3D839DBB818519BB261121B7FE337550BE26E931A6DF47B71F1D8CAA0BCBFC890D
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
274B9741A9320719AB9B4180FBAD7BF68373277296D511C6E617CF799553007716B699684CF43BF99D02E909B197CB95B6B6CE7DEBA29B63173480C5F4D65D09