1

I have a smart contract and i want a function (transaction) only be called if two addresses agree (maybe signs it or whatever), How can i solve this ? should i use Gnosis Safe to create a multisig wallet and send the transaction with that wallet ? or i can implement it directly into the function logic ?

PS: if only the first alternative is possible do someone have a resource on how to do it since Safe documentation is very bad ?

1 Answer 1

1

Something like this?

bool addressOnePermision;
bool addressTwoPermision;

function setaddressOnePermision(bool _addressOnePermision) public {
    addressOnePermision = _addressOnePermision;
}

function setaddressOnePermision(bool _addressTwoPermision) public {
    addressTwoPermision = _addressTwoPermision;
}

function store() public {
    require(addressOnePermision);
    require(addressTwoPermision);

    //your logic here

    addressOnePermision = false;
    addressTwoPermision = false;
}

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.