Action: Ics20Withdrawal
The Ics20Withdrawal
action allows a user to transfer funds from Penumbra to another chain using over an existing IBC connection. The action contains the following fields.
amount
— a transparent value consisting of an amount (u128
)denom
— the asset metadata of the asset being transferred, only thebase_denom
is useddestination_chain_address
— the address on the destination chain to send the transfer toreturn_address
— an ephemeral address where funds are returned; this will be thesender
of the fungible token packet datatimeout_height
— a chain height at which the transfer expirestimeout_time
— a timestamp at which the transfer expiressource_channel
— the IBC channel used for the withdrawal
Ics20Withdrawal::check_stateless
verifies that the timeout_time
is not zero.
Ics20Withdrawal::check_stateful
verifies that
the source channel exists and is not closed.
there is a connection and nonfrozen client for the channel.
the latest height of the receiving chain is less than the
timeout_height
.
Ics20Withdrawal::execute
does two different things depending on whether the funds being transferred are local to Penumbra or if they were originally transferred in from an external chain. In the case where Penumbra is the source, the total ICS-20 balance for the specified asset is increased by the transfer amount and the total supply is unchanged (see Finding ref↗). In the external case, the total ICS-20 balance for the specified asset is decreased by the transfer amount and the total token supply for the asset is decreased by the same. Then the packet is sent to the destination chain.