Skip to content

Commit

Permalink
Add multisig support for data in transactions or if destination addre…
Browse files Browse the repository at this point in the history
…ss has code
  • Loading branch information
bencxr committed Jun 23, 2016
1 parent 0aeff24 commit 5dcf2be
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wallet/wallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ contract Wallet is multisig, multiowned, daylimit {
// and _data arguments). They still get the option of using them if they want, anyways.
function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 _r) {
// first, take the opportunity to check that we're under the daily limit.
if (underLimit(_value)) {
// we also must check that there is no data (this is not a contract invocation),
// since we are unable to determine the value outcome of it.
if (underLimit(_value) && _data.length == 0 && !hasCode(_to)) {
SingleTransact(msg.sender, _value, _to, _data);
// yes - just execute the call.
_to.call.value(_value)(_data);
Expand Down Expand Up @@ -373,6 +375,13 @@ contract Wallet is multisig, multiowned, daylimit {
super.clearPending();
}

// Used to determine if an address may execute code
function hasCode(address _addr) returns (bool) {
uint size;
assembly { size := extcodesize(_addr) }
return size > 0;
}

// FIELDS

// pending transactions we have at present.
Expand Down

0 comments on commit 5dcf2be

Please sign in to comment.