@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1700609940 do
Contract.set_type "transfer"
# Send back UCO to bridge pool
Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 58.705
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1700609940
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Send back UCO to bridge pool
Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 58.705
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0x7EF9E4C3DADDEB11B3249A11A381E3B60D9DEA94CFCD5C1AD9A21C9AB9A00CD2,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0xf55cf385dc10d936231906d2841e5c16340c2bac", 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_uco_transfer to: 0x0000D2F8CAA957347A58A7E2FE5EE677640119899EE9944FC70B86B6D9DDD6934CFA, amount: 58.528885
Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.176115
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
81798ACB14E009EF538296F7B9EF29024ECBBB5980D909827E1D19148A83FC54FE334B76A74448FF7873D00FB410BC389BF10ABEA1A1D273E3EF891C
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 00000D8E...006CAt 2023-11-21 21:41:02 UTCAmount 58.93733725 UCO
Previous public key
00017BA868C5CCF25952A4FEEE3D931AACC45508DAC76781F48B706CB8C636AE2B38
Previous signature
0E43C76D1A7656B80449CB1BD81D5D406B929CD0F6F9FE1180D69DAECF4CCCAB023B6DD706AB121DC79710406C69D8585EAF986DE90BE971BC51A3137F2BD008
Origin signature
304402202B623015B8243474A6A25D48BAC48D53F7027BC2222328403F1DD8B33A640D0502200B8100E9E60652AB4515DD2F31644E037EF5585A1B33527CB95FE79FE86426E2
Proof of work
010104AB672F1E69B064D192819F1797C1926F158DBA8F3924AC732B4C4D70D0C8EA0A0D6506E5896C9C2524D2BE26CB5016287E1816A597C408008BA36FCB154A7765
Proof of integrity
00665D0CFC5298B23D2ABA0297E868124A981DDC02FED92D1A9F24525B30CB0B20
Coordinator signature
04296D48E604C614EF028D34DCE6ED8BB3170655538AEFB5701997281CCB9F3D8AA06646D18BD74884B9E2319DD48DF20446CEC38EDFEB78D51755F52959AC04
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
E965EF910EC49525BE48488AFD0F8083DDB8E7D2B5227F545B34DCB097464B50F9069457AFED0150A7508254D211F14857D5F84B500D803A63815F376D050B0B
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
B07773CE0894DB485A19A559565A04E415D9200E188E4836E632884037C0CF7C599298100EE535BCBF721FEBE9BA91960F970A59F495DC178446251E3CEC0F09