@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701862620 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0199, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1701862620
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0199, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0x1757DCB5B879C9EB3D2A99C1C3726623A6DD2C092AF33EB05D9055B66CA8A11C,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0x92078a37088f26e8a54fe334d6653ff3f30feae6", 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: 0x000030FB5F841975E6CB65DB7DE66DA41E39D96CBDE0BDBB781862D7F1B5B7088098, amount: 0.0198403, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 5.97e-5, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
BAA6204F4CACBBBC907F52AF8885F74A5CC2EE34491615B2AFD3E1E9CCEA2DB91E519FA31EA1895A1F771E747BBD4BBA31259C0F65AB133556CB8AC6
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 0000A8B6...37BAAt 2023-12-06 09:38:33 UTCAmount 0.3713013 UCO
-
From 0000E376...F072At 2023-12-06 09:38:27 UTCAmount 0.0199 0000288B...B827
Previous public key
0001DD670FB97A89F3E90F9856EDB26300FD9C4D7957435E84A74EF6C0355BFCB0A7
Previous signature
B0098FDCD0C14D67A6F512BB6D40711EE86202390712C2AF9730D382D2D901E50E48A68C984CE3FAAD16AADB5143FD6123D29E9D57200730754F90806EDA2D01
Origin signature
30450220397D329893F43705B73AB5E98C96894941BB491E729F78B7B8C8D9987BA00DC9022100FD819F826569F2DA0B0D79AA4207E243EA569FA01B5ED3FA90EA0D0AF5C19E6E
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
005C74EF3BF9E16DE71A3AA73852FB5AF5D63989AB07D7930A6583D9345348BC82
Coordinator signature
3EA488E28C46B6692E896A149CF37FD91259A1410FD5C7575853B568CB1064738E094BC8F88F5E66B2AB4F192CF51841D100952123542CB04D74B8784E065D06
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
95DF1DAE1F5DE8B2653BB595E66A26795A5A93E5A3129FECFBE0EF7C1AE89E4329660A00258E063E0E9A56310B5ED6050E56B8F83194A23AAE3D83CDB625CE02
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
80982EC30233E4784EC40977D9E1801265BF7FA83725E2230764BC4B87DF8B99854521991DA4B0BFAECC6E100E45D2231D21E6A8D7F390F5DB79A13D05148E0D