@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700001660 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.398, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700001660 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.398, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x0309DCD3F16C38B1CCB5E375A953102AD675D836FF7FD3358EC46209C49E6894, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "0x5c08747bcb6ab9dcde0e3dc75762ae841e874ff4", 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://sepolia.infura.io/v3/3a7a2dbdbec046a4961550ddf8c7d78a", "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: 0x00001675BECDA24450FAD82114A15B58567979E8E7AEA1CFFC54CE8C1779513EA2AF, amount: 0.396806, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.001194, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
F4DAD0AFA69A3AAC1B2C22A0776C1478675B2BCFC2D7DDD595033F5083F449C4298CE9DC43DD83B84F05846E834FFEB72D9ED185B7FE3BC456169FA8
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 0000ABDD...9200At 2023-11-14 20:42:35 UTCAmount 0.29960107 UCO
-
From 00007B99...819EAt 2023-11-14 20:42:30 UTCAmount 0.398 00003DF6...73B4
Previous public key
0001F8E6F29F60D215E2384FFB46384D11658B7439D8C5A95EAB0CA4AB52EE79FF85
Previous signature
108CB837BA16EED578FE956317883457EF2242A78AFAF415CFD3B63346E2C432185CBCE8DCC1F36143F887F98D5FB09BB58F391A019CE5BC494838740625F20F
Origin signature
30450221009000F2D1D93908BD36D7399BF26D33A710F417B46F9E84E8F907D41F2E617671022004C247E96779D56E68A9612D0F0D2D70481B445011D13BC6A2669A0A7D53DD98
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
00E257916674B06BA3E6AF8C344AF550F2E04E467DB25CCA35D98EAD813C247DAD
Coordinator signature
0EAE6ECD62CC0F70D475777B9E4AEC43E5CC73264BF373A2D714D1B246EC24034ABC546682FEF7AF6416398D46A3B84E3ACE9CE9736AE578AB6CA852C2215A0B
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
78E1AF48C572518FCDC7C21B26242DAA86F184D725F8279E438AA136AB96FB7E78DF2661F3F4770474CED62F1957B0A8C475A33B44F2348A07B741DA53CC770C
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
BDC46EDDE0D9411A77F6BD98CA3F2C973EBDA7F45BDDBF831FFDE0049AC7448AC7D04D82FE2827328A6D9944210C9055665FCA6C6851FA10805B1D1B42D73C0D