0

Vaults[0] is a contract desingned to call this function, so I want to ask areas in which Vault[0] can be impersonated to call this function

        function mintForCommerce(address _to, uint256 amount) public 
           nonReentrant  returns (bool) {
           require(msg.sender == Vaults[0]);
           address to = _to;  
           require (amount >= 0);
           _mint(to, amount * 1e18);
           return true;
        } 

1 Answer 1

0

For testing purposes, it is feasible to pretend to be the function's msg.sender (caller) in solidity.

If you have any more issues lemme know

3
  • Thanks for replying I'm trying to build a vault contract that handles funds so, what security measures should I take to prevent the impersonation of the Vault[0] address?
    – James Luiz
    Commented Sep 5, 2023 at 11:38
  • is there a way around it @Talha
    – James Luiz
    Commented Sep 5, 2023 at 11:48
  • can you share the rest of the code so i have a better understanding of the code so i can guide you better Commented Sep 5, 2023 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.