@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1700828640 do
Contract.set_type "transfer"
# Send back UCO to bridge pool
Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 99.2015
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1700828640
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Send back UCO to bridge pool
Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 99.2015
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0xE1AD41699B3814D0CC03C70F8E0255C72A4D96230D4637FF36554AB18E6C3A27,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0x34b50f24ce04f6c834a23eb9be40befd52a28082", 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_uco_transfer to: 0x0000D9E7B4300CC29670CA80010FE23292BEE4AE28057328732A0FF4CF11C319D81A, amount: 98.9038955
Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.2976045
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
FAF6AC117CFBFA5F7868797192725D7B5B8791CDAF2458F87B86886245128DD22D8BD57F26F9E42AB926B1D63AB433A620D7E650DBDFAEA77CB405E7
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000D229...7097At 2023-11-24 10:25:21 UTCAmount 99.43746419 UCO
Previous public key
00011611BA7B8EF882BF3C01D8889429DBD8BC7641D43BAC04C4BE846B5D4BF3E34A
Previous signature
F357429128F0F278D688DE3D5931F17F29482A021BB9020A13BF310D39B8666FD56C16C9D06F356A5D287F156356AF2BA5438B4403DF60C63A11BC9BF5655704
Origin signature
30440220538B5EB4EA37B4C8FACA4B447BD0F839C10BB5D3E23C836044DA7A38AD206148022046F35B3F4E5AD6AC535CC1B90750640792D5F04BE0F3B25DD803122A54661833
Proof of work
010204892A04DBE05192BCB662689E7E19700F3F7202028EF0A9F20635C4948436ED85A43BA3017281EE97781342DD8F24ED6F583B5FE542830FDB5191A11843A72A61
Proof of integrity
00670B4ACDD2C9E240712ABBB1DD5423E2FFD6D5F0C7F281BD4D87E6CCF98EF96B
Coordinator signature
B6AEB32DFAD8C6A7ECEA2A90DDD493B9D1B7320A6B841053C0331081D4819BD55B8C63BA829E501439ACF9FED87B91C2A00BF3F1F8BC9A2A119635D5B1FFE00B
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
6EB6ED9A393E1AA062E96CF6591994F7ED1399073F7DDB311522EB473C48B08D014EDE3C5D4E4E7D72DEF24AD85D13B516CD15DAC15F75D52A2B755C8A917207
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
80DBF5B3FB3C11C8434F5D166E193185B746D20883D6E7BD1906B8217E2BE498F0A6786017F8D12E79E0E5F18A329B67C0DD15AF89332075586ECABF69CFFD02