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())});

3 Answers 3

1

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)
1
  • I found the answer. See below
    – Russo
    Sep 9, 2018 at 14:59
1

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.

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)

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.