@version 1 condition triggered_by: transaction, on: provision(_evm_contract, _url), as: [ previous_public_key: ( # Transaction is not yet validated so we need to use previous address # to get the genesis address previous_address = Chain.get_previous_address() Chain.get_genesis_address(previous_address) == 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801 ) ] actions triggered_by: transaction, on: provision(evm_contract, url) do next_code = """ @version 1 # Automate the refunding after the given timestamp actions triggered_by: datetime, at: 1698164220 do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 5.97 Contract.set_code "" end condition triggered_by: transaction, on: refund(), as: [ timestamp: timestamp >= 1698164220 ] actions triggered_by: transaction, on: refund() do Contract.set_type "transfer" # Send back UCO to bridge pool Contract.add_uco_transfer to: 0x000018D60115ECE0C7558A46B4693749BF6BEAB524FDDCCF9B10B910619E4EE08801, amount: 5.97 Contract.set_code "" end condition triggered_by: transaction, on: reveal_secret(secret), as: [ content: Crypto.hash(String.to_hex(secret)) == 0x70D722E7D0DA4235FE43C0F93BDF110D6EA6E36FE4F6625B9CF7B06DEB551D2C, address: ( valid? = false abi_data = Evm.abi_encode("status()") tx = [to: "#{evm_contract}", 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("#{url}", "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: 0x00009E731DE71C9598A6C853EA89C736B1DAC3652AE00753651B642536AB14821F06, amount: 5.95209 Contract.add_uco_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 0.01791 Contract.set_code "" end """ Contract.set_code next_code end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
0CA8F369A74195A4BF7E42A4F433C3946E8B331374193F418D1773DCCB8C081EEFE6ACBB2D7329760441975CA0B561FDB75ECF1AC7364E2ED06DA7A5
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
-
Resolved 00009F95...B496request_funds
[ 1698164220, 5.97, "00009e731de71c9598a6c853ea89c736b1dac3652ae00753651b642536ab14821f06", "70d722e7d0da4235fe43c0f93bdf110d6ea6e36fe4f6625b9cf7b06deb551d2c", "0xe04b620c2f30112825e37ff6194c5aed12fbdb2693c3a8988a7bbfce2b595537", "0x577edfeb841089a05f67c3221c7121070e1d6522", 11155111 ]
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000AD35...20D8At 2023-10-24 14:18:07 UTCAmount 0.36497799 UCO
Previous public key
00011ED2ED2222B52B8F5560BFB95AC349730591D1E72903C9DE221523A6DD216328
Previous signature
8B24B5942BD1ED3108C2BB265EA25CB128296EEA65B21E4B5CB30549399E2939560DE9C3C0C5D06EEAEF1F787F17D5D32D2081B3F46311A1990B314C426EBF08
Origin signature
3045022100F616F65B45B83CE1103C567A6B24AC96575068CE17DC85A6D4877ECB097C800C022017A8780D553374217142DB485851645CCDD3692F8AAA8528B5D3FE7CFA3D40FE
Proof of work
010104AB41291F847A601055AEDD1AF24FF76FA970D6441E2DCA3818A8319B004C96B27B8FEB1DA31A044BA0A4800B4353359735719EBB3A05F98393A9CC599C3FAFD6
Proof of integrity
0057175D43E6B32BED4E911EBB04CF99CABEAF76EC2738F6AEEBE836E3F389A242
Coordinator signature
683F19C7886328F5DB7131294ABE8132302B4B70D63A97DF3E1EA459B7792432BC3BBE172D09F9EFA2BB1208F1328A7BD21234DB0C340810EBFFCBF81B615104
Validator #1 public key
00018A312AFA617E98B343D09AD2E73F0AB661DB0A59FB986D5DB8CE7664E14C25FC
Validator #1 signature
64C4F77D9F73790DB0F026BD9EA8DEFD8D65443166D7187B9934F34F735F3639FF673242BBD8AC94B0442B1624CC5A8D6233EF8D9D21B5BBE2815ABED1F54901
Validator #2 public key
0001500FBE298B79FFBDD5CCA1798F30FD88A53D26EC39DE5DDE1F4137B032A4BC34
Validator #2 signature
FE7BD3A352C5DACB7A8183C5C70BAB99C75576F6CCE4DD25BE4E368733F9D900739184CE9190556AFC562EE0E4662ACCD7A4FABD6AE4DDCA26654C2819951D0E