@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701957000 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.02985, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1701957000
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.02985, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0x089AF2158CEF11E1ABE37517D655EBB58E6F50D64452AA817D687E94F4DA5C15,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0x117ff9ed8a21dafda5acd04be1c353128203520c", 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://data-seed-prebsc-1-s2.bnbchain.org:8545", "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: 0x0000482A26BDA4D04918F5FAFE8225BA79FCCAB597B00F6F5D06E39C90689BFE2319, amount: 0.02976045, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 8.955e-5, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
67196D0DD59A0FA327B8B0C53F1977A028A0CD116540FA5E63E45DC59085C22F01DB684B67D340981DB5BB1610ECEAB6D661989AFB2462172DC94DB9
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 000099B7...98BBAt 2023-12-07 11:52:39 UTCAmount 0.35070159 UCO
-
From 00004C05...7F04At 2023-12-07 11:52:29 UTCAmount 0.02985 0000288B...B827
Previous public key
000131DAB1D7000B165068C144E9691BE83AC23A19A05CBE6EDB83539725683C4912
Previous signature
8201EBB62CFDAD327D29943E9135BB914D1ADBD58D4E130954E208C3050A012F5713117632B0CDAACFAF9235BD04543E18C2B567D4A66169DE1C89A10AC6F10B
Origin signature
30440220230431926EFC7EABF185434CCC32DBE958FD46B3F54AF353535A540D2E3C442002202CC244755D7AFCA07C1443B6A55A0F884AC02D9DE4A56AC0483F371F3DD40A2E
Proof of work
010204D6052E0C6CA9244CDE5F3D664296BDFBA0090B330404C3C16B098758F27965DFEC0D3F25D1365F389C2B6C516195552F8779DEE0796C8C33F1A9C0404F4E3381
Proof of integrity
00137E26C8C162D0328A8CE0D2C6A663F4CEC051963196FC6B287C6F4AF784E05A
Coordinator signature
08097D961823F19F1B4B135C5F1E6D4B696388AACE399170204AB8CD62E40AAFE04EDAB5637D8C241B8D76FC0D724E0DB0415408B2C1F7F758E02A5811591C04
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
3ABC340ABEB18CAF14454FCBE28942ABA2EC099F0FE3CDB802B781A1D2E793143B9A62CCA8121BC9200ED1ABDFD91EE7712C99FF1406CE232B967221F1949900
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
F4053FA8C2CFDF37D6FD7254298E69B0AB88E10B630C077B06CC07860F7035B1D2BCD3192605E7DAA773E83420F10A529D6476A07A15C0EBD8C2527314BBAE04