1

I've deployed a MultiSigWallet from ConsenSys. How can I call functions with onlyWallet modifier?

modifier onlyWallet() {
    if (msg.sender != address(this))
        revert();
    _;
}

Does the address variable need to be an account address or can it be a contract address?

var data = multisig.replaceOwner.call(web3.eth.accounts[1], web3.eth.accounts[2], {from: address}, function(err, res) { console.log(res.toString())});
0

The onlyWallet modifier means that a transaction needs to be confirmed with multiple signatures first. In order to do that you need to:

1.Submit transaction and get transactionId

function submitTransaction(address destination, uint value, bytes data)

2.Confirm it with the required number of confirmations from owner accounts:

function confirmTransaction(uint transactionId)

3.Execute transaction:

function executeTransaction(uint transactionId)
| improve this answer | |
  • I found the answer. See below – Russo Sep 9 '18 at 14:59
0

onlyWallet transaction is not for confirmation , it's checking if caller is contract itself.

modifier onlyWallet() {
    require(msg.sender == address(this));
    _;
}

address(this) is contract address.

| improve this answer | |
0

Oh, I just found that transactions can send the code as a "byte data" param and thus call any contract's functions. :)

addTransaction(address destination, uint value, bytes data)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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