When trying to build a program with this function (from one of the exmaples given):
function transferSolWithCpi(uint64 lamports) public {
AccountInfo from = tx.accounts[0]; // first account must be an account owned by the program
AccountInfo to = tx.accounts[1]; // second account must be the intended recipient
print("From: {:}".format(from.key));
print("To: {:}".format(to.key));
from.lamports -= lamports;
to.lamports += lamports;
}
I get a failed build saying:
error: assigning to incorrect type uint64
┌─ /mnt/c/<my-path>/solidity/tryPay.sol:38:14
│
38 │ from.lamports -= lamports;
Does anybody know how I can fix this? I copied the exact same code as in the example