function flip(address _addr) public payable {
total += 1;
payable(_addr).transfer(1);
}
How to call this in Solana:
await program.methods
.flip(transferToAccount)
.accounts({ dataAccount: dataAccount.publicKey})
.rpc();
Isn’t this right? How can I transfer the sol into the contract?thanks
function flip(address _addr) public payable { total += 1; payable(_addr).transfer(1); } How to call this in Solana: await program.methods .flip(transferToAccount) .accounts({ dataAccount: dataAccount.publicKey}) .rpc(); Isn’t this right? How can I transfer the sol into the contract?thanks