@version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1700073900 do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.00995, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1700073900 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Burn the non withdrawed tokens Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.00995, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0xECC3A6A7C7C696C78461ACB4DC927ABAA3F444A6EA24A735C3A3FD42107D7370, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "0x6ff9e4bf07214583668114435829d605c9d6f946", 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: 0x00000BC0EBA2DBCE4455B46F5E51AFAABA6EB4C7FBA1D4E2E6DABD55DC70F9A04D6F, amount: 0.00992015, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.985e-5, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4 Contract.set_code "" end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
D4C4B775A2D849957318DA9A10FBA42BE9811C9D4E75C859BA9FA35F88735485F71C0C77AF58102991D347B51F962C8EAD664D6C53CB6EB619F50242
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 000003FD...34CEAt 2023-11-15 16:46:11 UTCAmount 0.29908582 UCO
-
From 00009D05...30E6At 2023-11-15 16:46:06 UTCAmount 0.00995 00003DF6...73B4
Previous public key
0001521B3F173FBA8F06E5507F4545DBD92D977A270522856E361662191B6E3143F8
Previous signature
8EE7B0F585B8B404AE5287ABA53C57E3487B2CB6360008A0366E45ACB8D6F0AC0612BB2136B0554D09A3A9DAC1A1DA30D2E815662FF788F5A62B57AC0D54DA07
Origin signature
3045022100DB9D4900F1B7D344093610E63C324F468C3DC8F02A719E0055DDF9D7ACFD372002203B23969C1CC204CEA21F9CB94B72259CBAC70B7F226A3ACDEE1D719C08772FCD
Proof of work
010204E9BB401A767B0C92D5DB139379AAB18E1B449B455F49E3A44F3466B2D38E59F0516B79493A528A95E5A74CF46F79CF12DEB73293458F6A4403D2B3E57D697347
Proof of integrity
000FDC5D3C90C524864A93058BEE58A0EECE648B448A0AFF7208D6FB6997F08679
Coordinator signature
09F479EF80DB4B9A9C020BC7648BF908924CAA03FB08A8BB2E08007D8BCFBEB5139558312847CB7C76BB77B95C45A7AA219743C05041781019098B280A057E0D
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
0D9C103DCAD64BFB0FC79AADE2A7EC703C928205021178CF3706CF8A7B74C43A0654E2051AFD2C6C2EF535318BC91458ADECA7CE18B36FF5FB6F611565B8C406
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
C803E01629C3CBC1783BC7B4467247E136B2334F1F100F2671F3C30ACDE243A682D22414BDDE3608D3A57358DEB775AD4E2BE5C1EE6870ED9603C0CF278F7609