Lesson10: why we write vm.prank in setUp function before ourToken.transfer? #1916
Answered
by
EngrPips
codeplay22
asked this question in
Q&A
Replies: 2 comments 14 replies
-
Hello @codeplay22, Please show your full |
Beta Was this translation helpful? Give feedback.
9 replies
-
deployer = new DeployOurToken();
ourToken = deployer.run();
console.log("address of address(this) in OurTokenTest.t.sol is", address(this));
console.log("msg.sender balance is", msg.sender.balance);
console.log("address(this).balance", address(this).balance - (STARTING_BALANCE));
console.log("The balance of this contract is: , ourToken.balanceOf(address(this)));
ourToken.transfer(bob, STARTING_BALANCE);
} Run this code, and it should print the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When i don't type
vm.prank(msg.sender)
in setUp function this error comes, but when i check the balance ofaddress(this) it's 79228162414264337593543950335
which is much higher thanSTARTING_BALANCE which is 100 ether
and if i also check the balance oftransfer function in ERC20 Which is coming out to be 79228162414264337593543950335 only
still it's giving me ERC20InsufficientBalance (you can see it in the image down below). Why this error is coming? it should not come because owner have balance of 79228162414264337593543950335 which is much higher than 100 ethers, so it should tranfer it??This is my setUp function
Beta Was this translation helpful? Give feedback.
All reactions