@version 1
condition triggered_by: transaction, on: refund(secret, secret_signature), as: [
previous_public_key: (
previous_address = Chain.get_previous_address()
Chain.get_genesis_address(previous_address) == 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D
),
timestamp: timestamp >= 1774040100
]
actions triggered_by: transaction, on: refund(secret, secret_signature) do
Contract.set_type "transfer"
# Send back the token to the user address
Contract.add_uco_transfer to: 0x000078568EA8D66A60EC971FF34A4A53487674EDBB88CF58ED2BB73AD05CE21A94E8, amount: 5500
Contract.set_code """
@version 1
export fun info() do
[
evm_pool: 0xd5ca9f76495b853a5054814a10b6365ee8ed745b,
ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D,
status: 2 # REFUNDED
]
end
export fun get_secret() do
[
secret: 0x#{secret},
secret_signature: [
r: 0x#{secret_signature.r},
s: 0x#{secret_signature.s},
v: #{secret_signature.v}
]
]
end
"""
end
condition triggered_by: transaction, on: reveal_secret(secret, secret_signature, _evm_contract), 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) == 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D
),
timestamp: transaction.timestamp < 1774040100,
content: Crypto.hash(String.to_hex(secret)) == 0x28221A33CB9A4418D5760291DBBFDA8A171C262D39A3982BB1A470C736553E7A
]
actions triggered_by: transaction, on: reveal_secret(secret, secret_signature, evm_contract) do
Contract.set_type "transfer"
Contract.add_uco_transfer to: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D, amount: 5500
# Transfer fee is less than the minimum decimals
Contract.set_code """
@version 1
export fun info() do
[
evm_contract: #{evm_contract},
evm_pool: 0xd5ca9f76495b853a5054814a10b6365ee8ed745b,
ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D,
status: 1 # WITHDRAWN
]
end
export fun get_secret() do
[
secret: 0x#{secret},
secret_signature: [
r: 0x#{secret_signature.r},
s: 0x#{secret_signature.s},
v: #{secret_signature.v}
]
]
end
"""
end
export fun info() do
[
evm_pool: 0xd5ca9f76495b853a5054814a10b6365ee8ed745b,
ae_pool: 0x00002075E9FB5329C7F5149802EB75F925D79B5FEC5BFCF09DC81993CB9C39FEAF5D,
status: 0 # PENDING
]
end
export fun get_htlc_data() do
[
amount: 5500,
end_time: 1774040100,
secret_hash: 0x28221A33CB9A4418D5760291DBBFDA8A171C262D39A3982BB1A470C736553E7A,
secret_hash_signature: [
r: 0xE716CC4FC6EC611F059AEB77D247286F5D2A7DC6238583EA0613B6CA0D740705,
s: 0x164ADCCF9AAB9CB9F0A4B8579CA652F232AB31474CED82A610D4E51913671D9F,
v: 28
]
]
end
Content (0 B)
State (0 B)
-
Secret shared with 1 key
Encoded secret
02D956BBFCA16CF52025FD0A3A68A93F85612FC60985907A65A72CB7E55A3C15E5FB343911C56FAB8A7F247F3DD1E9A81528660BB1887EAD88E7A722
Authorized keys
- 000122A6CD9ED07E46835D6E88E5BD0BEE84C3F5E5DBF8E916AD9B2EC912C44AFEC2
Contract recipients (0)
Inputs (0)
Contract inputs (0)
Unspent outputs (1)
-
From 0000872A...6DD4At 2026-03-20 18:56:20 UTCAmount 5,502 UCO
Previous public key
0001DF1609E8987F93B770F04BDCBB5EDC879DF643B43C126C514DB58E27A6A452FE
Previous signature
7F6088CDDE675E3500CDF03584C0D7946271831F0898CAE20C9E4555123E58B7FBA1D16F11A9C964F385CF9BB8D5D65C0AC3A99679C269AB783F2731A915C20A
Origin signature
3045022100E95EF841A54881C6760D60B22FF64A0823B24BA197C7D52788F0961B8CCB486A02200FE5C1CE53AD24CF25D11E094051122C5A9549D0D26C875FCD7A31719279CA3C
Proof of work
010104AB5E344FDF6D10F896DB484265B6A99C282A76CA6C57D4868CCFBB10EC3DA4F5005892D5DE88790A34D10246E1120736EA2FC14AED43517408709D09B4BB4E5B
Proof of integrity
0048B1FA0777EC779520D1F945C664204ED9EF1DCAD7AD9F4028E1B71C547CFC3E
Coordinator signature
3C72E76FEFDC9F4BFBB98E588149217637DC9533C3759D90F27B8C24B1B5DAA29662738134F4005E2E42B861B3AF24D3365942E48927351728708EB372037309
Validator #1 public key
0001B51ED06CB38FE743020C85164332709917028F52CD924EF2939A65E5A1E20D31
Validator #1 signature
C557391EAD8195FF9E3EE6C3254160F95D1ACB3A63535F71A60AEEA901BF74135E68D66A4A16592C06A45557C864543B5840B779422E65C03DC949E2B73B6B01