For my task, I have to call my contract's methods which use onlyOwner modificators, and basically has some authorizing logic. How do I call contract methods with some specific account? For example, if I have basic ERC20 token contract:
contract MyToken is ERC20 {
function mint() external payable onlyOwner {
_mint(msg.sender, msg.value);
}
}
and want to call it from web3 on server side, how do I connect account to web3 client so I could call it like that:
myToken.methods.mint().send({from: 'myAccountAddress'});
How do I make web3 know that I have access to this wallet address?