@version 1
# Automate the refunding after the given timestamp
actions triggered_by: datetime, at: 1701388260 do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: refund(), as: [
timestamp: timestamp >= 1701388260
]
actions triggered_by: transaction, on: refund() do
Contract.set_type "transfer"
# Burn the non withdrawed tokens
Contract.add_token_transfer to: 0x00000000000000000000000000000000000000000000000000000000000000000000, amount: 0.0995, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
condition triggered_by: transaction, on: reveal_secret(secret), as: [
content: Crypto.hash(String.to_hex(secret)) == 0x88571241357F95F009B8F737C349B2BA90DDAA6B7692E448918EA18AE1BCCBFF,
address: (
valid? = false
abi_data = Evm.abi_encode("status()")
tx = [to: "0xcdf2e3fc71527f724c7087acdb76c64e2be2826f", 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: 0x0000064F114419DD1BA0B495E4B596513A180BCC4F58643496F0919DCC3B6313BEA1, amount: 0.0992015, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.add_token_transfer to: 0x0000749d250560bf06c079832e0e9a24509b1e440a45c33bd9448b41b6a056fc6201, amount: 2.985e-4, token_address: 0x0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827
Contract.set_code ""
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
72AA4E79CA26EB65D19C3CD79FEE8773CAE6170F9C0F02BB818B849BBF3E9FB2C7815019E92393F05989F9E0505FDAE7B24BB949764E6D5B106F2B4D
Authorized keys
- 00017877BCF4122095926A49489009649603AB129822A19EF9D573B8FD714911ED7F
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (2)
-
From 000076CC...4F87At 2023-11-30 21:51:46 UTCAmount 0.35277198 UCO
-
From 0000395B...18C7At 2023-11-30 21:51:41 UTCAmount 0.0995 0000288B...B827
Previous public key
0001FBA2B35BB6E98365D7E25374A81C48DC18577B7B7CF94136EC26DDD5282831EB
Previous signature
BAED35A77FCE75B530012D53F547EA488C1068A1D5672AA6490BB92FB0A9E2851E27E6318AD81AF233A1A77E7E94A7F6576018B6528C561CC8598EE7706F1002
Origin signature
3045022024E7FD5178FDD3B8703A7AF10F86299035CD840DCB2292831299FC6ED785D1F6022100FBEDD84CAF641117FD7A4D1685194816555AA47BF78A56F02BE00C8938651224
Proof of work
010204892A04DBE05192BCB662689E7E19700F3F7202028EF0A9F20635C4948436ED85A43BA3017281EE97781342DD8F24ED6F583B5FE542830FDB5191A11843A72A61
Proof of integrity
00C28316AE349BB3729B181639058F033F2BFD5113D05A987D7A2B3A951D490FE6
Coordinator signature
3B6A782ECC536186580BF46C2D169C4ED7CCAFE682CAFAD2D62278DE77E08FCEA148B033C8B2A31784A806CF952C657E3E9D427B2E00FF4641A11DD28F0D8D00
Validator #1 public key
00011B58ED42235461734EAF253BD97A80B92899ABCC3BE680D44B6825DD2A88A947
Validator #1 signature
98B137275FB74400CD40EF5DACBD0687D783EBE499F7CF7D3AEDD2F0814557E02AD753BC84AF45C74799EEAE31AE534318A512CCE9A7CCBDE89E77BA22A15208
Validator #2 public key
0001B0A94804BF8ECC9897075C6207FF63EF4D339F57A0349888E6B77CD47DB53EF3
Validator #2 signature
753DAC0F26A64732448FA9770FB72C942824EFE307B317C39980E9E1B0F7CA1C2D79EDF24F962AC8412C5CFEA3617941FF7D248FFA90267D5D8D2EF0111A0A07