Skip to content

Lesson10: why we write vm.prank in setUp function before ourToken.transfer? #1916

Answered by EngrPips
codeplay22 asked this question in Q&A
Discussion options

You must be logged in to vote
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.18;

import {Script} from "forge-std/Script.sol";
import {OurToken} from "../src/OurToken.sol";
import {console} from "forge-std/Test.sol";

contract DeployOurToken is Script {
    uint256 public constant INITIAL_SUPPLY = 1000 ether;

    function run() external returns (OurToken) {
        vm.startBroadcast(); <@ here
        OurToken ot = new OurToken(INITIAL_SUPPLY);
        // console.log("address(this) in DeployOurToken.s.sol is",address(this));
        // console.log("address of ot is",address(ot));
        // console.log("msg.sender is in DeployOurToken.s.sol is",msg.sender);
        vm.stopBroadcast();
        r…

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
9 replies
@codeplay22
Comment options

@EngrPips
Comment options

@codeplay22
Comment options

@EngrPips
Comment options

Answer selected by codeplay22
@codeplay22
Comment options

@EngrPips
Comment options

@codeplay22
Comment options

@EngrPips
Comment options

Comment options

You must be logged in to vote
5 replies
@EngrPips
Comment options

@codeplay22
Comment options

@EngrPips
Comment options

@codeplay22
Comment options

@EngrPips
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants