@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701962700 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 >= 1701962700
]
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)) == 0xD23A2B0EA02F8668E514975DB43226FD2082ECBC11BEFBE87F7FA6A13C7FF9F5,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0x40dc52114032aa8079821e3ed4a84394914f7e0d", 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: 0x00005812E57B735BA93F77AC9DCF7DFD402B8C562D8AD7AF7EF3C9B5D408F4BDDF5D, 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
A39D06897ACF44E73BD94F8C666F1796E5F2B5036BCD77D83130259BFD498AD8E550701665845D4177167B93877D61E78C9248F954515F4C4333A1C4
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 0000CCDF...60CCAt 2023-12-07 13:27:20 UTCAmount 0.34246478 UCO
-
From 000063AC...729CAt 2023-12-07 13:27:14 UTCAmount 0.02985 0000288B...B827
Previous public key
0001A9894B477E0E08149DCBA0C39F99BD1F88740F08DFFFBFBF9C0FC8AE58F4A097
Previous signature
11642C7A86C8C724D128DB036A4AF9BE0364C05809E9AE9684D4DFADE3000143B5CFA567ACEC0AE9E9670C9B914602F34412AA88096861AE56CA016F4F5E9C06
Origin signature
304502207BEE8B874D5206EAC71FB60AABD003D87383F62C67A0EC59E28BC37049F7812A022100E19B6BFE7D3617AD997F759ADE2AC1B68FEC4FFC3D43D4E55AC2708F20C1061A
Proof of work
010104228ED9FE757FA46CEDCAE4E3FDDEC1EF6511A71B15E5611AA36EA41DFB969EF2FB83D72D13AD1E89873CD4EFF1364880B3557D72AE5188EF5E1BD09253CE235A
Proof of integrity
00FFD7C164ACACE4D32CFC29F92D8610B794B1F125C31A7FA267863B86286BE9DB
Coordinator signature
F1F9B6F56EC659039FE54A5F4D7C18FFC6C0964BB5C71040AA91893B43022B377E55BF38937CD330BCC9B0EDAA4296A3576569FB3556309E75925F00AC906408
Validator #1 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #1 signature
BB2858C2FF6E513ACE60AF8FEAFBF05F841B2A4206388744637BA2FC77BE64AE71D648EB695EBB2A672483384E5CC40594D3D4ECC66B5BED822EC2EF1AABCE05
Validator #2 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #2 signature
9CB1C95F28F31B7DD3BF31049FA4CEF670F2CBB8752B61E981DF15F0B0E0713AE2A6509DDD94C7A72BE65B0F36F8868EF672448F01386B633631F26DA3C49D08