Skip to content

Transferring Balance

pchain_sdk::pay transfers balance from the Contract Account to another Account and returns the balance of the recipient after the transfer.

See the example smart contract "ContractProxy" in chapter_3 of repository of Parallelchain Lab.

/// ### Lesson 4:
/// use method pay() to send tokens from this contract balance to specific address.
fn send_tokens(value :u64){
    let contract_address = pchain_types::Base64URL::decode("-jUt6jrEfMRD1JM9n6_yAASl2cwsc4tg1Bqp07gvQpU").unwrap().try_into().unwrap();
Back to top