@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701799200 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.2985, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1701799200
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.2985, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0xFEAF948D1A869C5E4A8079ACF0DA334FAFB63D66C9A501862AC825B2D413A976,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0x4b2e243a05ca255a311df18f257a9f4b6f5be027", 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: 0x0000B57F380A6FDD0E091BF06894748657AC79686AED964A3F2A9DD87527632F6AE3, amount: 0.2976045, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 8.955e-4, token_address: 0x00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
EB939FCC6D21D98BDDD2D824B0D87E0D0D6387F96A545123765EF2E7AD130525A9E239AB8DBCD725F4B4FCCE6335405C7EE0BA870BEAFB77B1BC6A52
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00003064...C596At 2023-12-05 16:03:22 UTCAmount 0.36760753 UCO
-
From 000071F0...B59AAt 2023-12-05 16:03:11 UTCAmount 0.2985 00003DF6...73B4
Previous public key
000136BF95BA634A328EA148A175F07FCF8B8BF51A238D6F23608656CACAD413468E
Previous signature
BCDE3F37BF1E42D714ADCECE9D04384C4F1B573D6E11A058EE5F13C4120887F80D3318AA1990D143EA5CCF613A834B83DD371E32128F810BA426A8CE454EE205
Origin signature
3044022077D704FCFA863127A83DA1BE2791F613237F27C296F55D068C93999AB9EE5D9D0220402C7F2D35786A723C072E8B212136A80FD211F481DD627FCB5E33A72326C762
Proof of work
010104228ED9FE757FA46CEDCAE4E3FDDEC1EF6511A71B15E5611AA36EA41DFB969EF2FB83D72D13AD1E89873CD4EFF1364880B3557D72AE5188EF5E1BD09253CE235A
Proof of integrity
00CC5971A2D2339D9483294C881E9D3BFDFB44AD94BDBBA25B41433043698AE73A
Coordinator signature
4B32A2D1EAE1ED08AE195DC8D7788500209B75F863EAF96039B541A6C74C40661FA19933BF1808B4641BA2F6D42BFD239ACF8EBBAAE1D98678835FC2425DCF07
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
63627E5C2915CA5C310767C2AB8A6E71C932DF48B8527F9F5E1883B7966AF6DB543B6B80D3BD27442817CC38F97A2A588CD16DB09B19A7E67EE9E2DDFA3D4B0E
Validator #2 public key
000151C124A6211CD402FD1CFE560C5DB51ED0CBEF44B09B21A41206028E7E5942BF
Validator #2 signature
5EC2B7A124AB49A4422B77BF90DADB70DC71A308494228791E5FDFB414B885D2FEA3E888304552CF411001E3252765557E008FAA2F1B4FAE01A8866172A8580F