@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1699998120 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1699998120
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0xA43119BA03DB4975550170F4C2D119C1174039DA0829C98C1FD171526B8C03E1,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0xe1f3f34aaebb1fa7eb66a47c24c048d57f823639", 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://polygon-mumbai.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: 0x000024EFC168359BBE0ABF897270CBFABBFF5784622EA02A463BA2EAF7C5219EAFD7, amount: 0.0992015, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.985e-4, token_address: 0x00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
F37731B44A4A6F821A377946D4B94400425A966FEA22CA2B785E75FFEA76EC01ABD7F08CA979602B71861EC18879C95D569438DA9140415C459BC21A
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 00007705...7F37At 2023-11-14 19:43:07 UTCAmount 0.30262435 UCO
-
From 000071E8...2055At 2023-11-14 19:43:03 UTCAmount 0.0995 00001A4A...01F1
Previous public key
0001A634C11E8316B4FA24528DDFC0CD8A273651DC35C317D7BE0F935CC737F73FFC
Previous signature
3948188475F7602514977B871EF824C88E5B7AE620A783EE81547B3DA37A0527AAEA58C9EC7639762DF92895BC134792EE140E92D5E4A1A42AA7E6E6D392DD0A
Origin signature
3044022001F21218BF1FFABDE8C6E98F8A502B31FC454CF553F15D8A4ECA65D301387BC8022054BABF1AD7F50F040A5C951CAE2215D6EA12FC85CB29496CB1650BFCF21807CF
Proof of work
010204E9BB401A767B0C92D5DB139379AAB18E1B449B455F49E3A44F3466B2D38E59F0516B79493A528A95E5A74CF46F79CF12DEB73293458F6A4403D2B3E57D697347
Proof of integrity
00C995115906B4C3C4224DEA61CE40DCC21C797B65B5CBE11538CA03636E6C9F37
Coordinator signature
7C6B91B1CCDCA7D9E49CC3076EB1EF41D68D55B3BD1D2701074C96E9C7978E4AF85A04861DCCDFAE7A814D50327897A77349F46B966C6DA82A8E9857382F360C
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
E11237518EC1C73A9BA52BB82BA857B96D79DB9BBDDEA2DC21D9F7CEB662AEB7F70E26CC438966B9192D0897AD12518BDF897A446B9BA4FB28E96784379F9309
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
BBFAF367D4B5FA9B26B20E66B86EA8761FB386A8A43DEEB8B641E6A6E00068F7D4729BBF7AFA545A5A2D0327897E718F0AA7A07FF38B61223E2F6E7BF55CD801