Closed thegostep closed 5 years ago
@thegostep should this apply to the punish function too?
punish
Currently the punish function looks like this:
function punish(address from, uint256 currentStake, uint256 punishment, bytes memory message) public returns (uint256 cost) { // restrict access require(isCounterparty(msg.sender) || Operated.isActiveOperator(msg.sender), "only counterparty or active operator"); // execute griefing cost = Griefing._grief(from, _data.staker, currentStake, punishment, message); }
So if we were to change it to use msg.sender, it would look like this:
msg.sender
function punish(uint256 currentStake, uint256 punishment, bytes memory message) public returns (uint256 cost) { // restrict access require(isCounterparty(msg.sender) || Operated.isActiveOperator(msg.sender), "only counterparty or active operator"); // execute griefing cost = Griefing._grief(msg.sender, _data.staker, currentStake, punishment, message); }
The stronger assumption of always taking funds from msg.sender is necessary to avoid relying on approval amounts to control access to funds on the contract
@thegostep should this apply to the
punish
function too?Currently the
punish
function looks like this:So if we were to change it to use
msg.sender
, it would look like this: