diff --git a/contracts/ServiceNodeContribution.sol b/contracts/ServiceNodeContribution.sol index 7c79369..989948c 100644 --- a/contracts/ServiceNodeContribution.sol +++ b/contracts/ServiceNodeContribution.sol @@ -88,6 +88,10 @@ contract ServiceNodeContribution is Shared, IServiceNodeContribution { /// key, a signature and the fee the operator is charging. /// @param reserved The new array of reserved contributors with their /// proportion of stake they must fulfill in the node. + /// @param _operator The owner and operator of the node that will be + /// deployed from this multi-contribution contract and consequently the + /// recipient of the operator fee and admin access control of the + /// multi-contribution contract. /// @param _manualFinalize Configure if the contract automatically (or does /// not) finalize the contract upon receipt of a contribution that /// funds the total required staking requirement of the contract. @@ -100,13 +104,14 @@ contract ServiceNodeContribution is Shared, IServiceNodeContribution { IServiceNodeRewards.BLSSignatureParams memory sig, IServiceNodeRewards.ServiceNodeParams memory params, IServiceNodeRewards.ReservedContributor[] memory reserved, + address _operator, bool _manualFinalize ) nzAddr(_stakingRewardsContract) nzUint(_maxContributors) { stakingRewardsContract = IServiceNodeRewards(_stakingRewardsContract); stakingRequirement = stakingRewardsContract.stakingRequirement(); SESH = IERC20(stakingRewardsContract.designatedToken()); maxContributors = _maxContributors; - operator = tx.origin; // NOTE: Creation is delegated by operator through factory + operator = _operator; address nilBeneficiary = address(0); _resetUpdateAndContribute(key, sig, params, reserved, _manualFinalize, nilBeneficiary, 0); } diff --git a/contracts/ServiceNodeContributionFactory.sol b/contracts/ServiceNodeContributionFactory.sol index 50dd692..2bcd2ed 100644 --- a/contracts/ServiceNodeContributionFactory.sol +++ b/contracts/ServiceNodeContributionFactory.sol @@ -38,12 +38,13 @@ contract ServiceNodeContributionFactory is Initializable, Ownable2StepUpgradeabl sig, params, reserved, + msg.sender, manualFinalize ); result = address(newContract); deployedContracts[result] = true; - emit NewServiceNodeContributionContract(result, params.serviceNodePubkey, tx.origin); + emit NewServiceNodeContributionContract(result, params.serviceNodePubkey, msg.sender); return result; } diff --git a/contracts/test/ServiceNodeContributionEchidnaTest.sol b/contracts/test/ServiceNodeContributionEchidnaTest.sol index 173abba..9945671 100644 --- a/contracts/test/ServiceNodeContributionEchidnaTest.sol +++ b/contracts/test/ServiceNodeContributionEchidnaTest.sol @@ -75,6 +75,7 @@ contract ServiceNodeContributionEchidnaTest { /*sig*/ blsSig, /*serviceNodeParams*/ snParams, /*reserved*/ reserved, + /*operator*/ snOperator, /*manualFinalize*/ false );