From 5b0bfd376583be8099d7c40cc697011f722c87f4 Mon Sep 17 00:00:00 2001 From: enkogu Date: Tue, 30 Oct 2018 11:26:19 +0700 Subject: [PATCH] #359 --- contracts/governance/GenericProposal.sol | 1 + contracts/utils/GenericCallerLib.sol | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/contracts/governance/GenericProposal.sol b/contracts/governance/GenericProposal.sol index 7fab1a2..7b3c72e 100644 --- a/contracts/governance/GenericProposal.sol +++ b/contracts/governance/GenericProposal.sol @@ -67,6 +67,7 @@ contract GenericProposal is IProposal, Ownable { */ function setVoting(IVoting _voting) public onlyOwner { voting = _voting; + params.push(bytes32(address(voting))); } /** diff --git a/contracts/utils/GenericCallerLib.sol b/contracts/utils/GenericCallerLib.sol index 7c19497..86fba9f 100644 --- a/contracts/utils/GenericCallerLib.sol +++ b/contracts/utils/GenericCallerLib.sol @@ -41,12 +41,20 @@ library GenericCallerLib { _methodSig ); + bytes32[] storage params; + for(uint i=0;i<_params.length; i++) { + params.push(_params[i]); + } + + params.push(bytes32(address(0))); // last param is always voting; in this case no voting created + // 1 - call immediately if(!address(_target).call( bytes4(keccak256(_methodSig)), uint256(32), // pointer to the length of the array + uint256(_params.length), // length of the array - _params)){ + params)){ revert(); }