Solidity任何人都可以呼叫 Gnosis 錢包的“submitTransaction”函式嗎?也只有所有者可以
任何人都可以呼叫 Gnosis 錢包的“submitTransaction”函式嗎?也只有所有者可以executeTransaction
?
在查看 Gnosis Multisig 錢包(https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol#L184)時,我注意到
submitTransaction
函式的註釋說允許所有者。但是,在函式聲明上,它沒有ownerExists
要求。那麼這是否意味著評論應該允許任何人?/// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); }
函式也是如此
executeTransaction
。評論說允許任何人,但它ownerExists
在函式聲明中。/// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; //if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } }
由於 gnosis 多重簽名合約似乎是最安全的,並且以持有大量資金而聞名。我懷疑這是一個錯誤。但我想知道我對
ownerExists
需求的理解是否正確。
功能
submitTransaction
沒有ownerExists
要求。但它呼叫了函式
confirmTransaction
。