Update onlyProxyOwner modifier to onlyIfOwnerOfProxy

This commit is contained in:
Gerardo Nardelli 2018-12-14 11:44:02 -03:00
parent ac0e671aeb
commit b25c25ccae
6 changed files with 7 additions and 6 deletions

View File

@ -127,7 +127,7 @@ contract BasicBridge is EternalStorage, Validatable, Ownable, OwnedUpgradeabilit
return executionDailyLimit() >= nextLimit && _amount <= executionMaxPerTx();
}
function claimTokens(address _token, address _to) public onlyProxyOwner {
function claimTokens(address _token, address _to) public onlyIfOwnerOfProxy {
require(_to != address(0));
if (_token == address(0)) {
_to.transfer(address(this).balance);

View File

@ -10,7 +10,7 @@ contract OverdrawManagement is EternalStorage, OwnedUpgradeability {
event UserRequestForSignature(address recipient, uint256 value);
function fixAssetsAboveLimits(bytes32 txHash, bool unlockOnForeign) external onlyProxyOwner {
function fixAssetsAboveLimits(bytes32 txHash, bool unlockOnForeign) external onlyIfOwnerOfProxy {
require(!fixedAssets(txHash));
address recipient;
uint256 value;

View File

@ -9,7 +9,8 @@ contract OwnedUpgradeability {
return IOwnedUpgradeabilityProxy(this).proxyOwner();
}
modifier onlyProxyOwner() {
// Avoid using onlyProxyOwner name to prevent issues with implementation from proxy contract
modifier onlyIfOwnerOfProxy() {
require(msg.sender == upgradeabilityAdmin());
_;
}

View File

@ -38,7 +38,7 @@ contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge {
return bytes4(keccak256(abi.encodePacked("erc-to-erc-core")));
}
function claimTokens(address _token, address _to) public onlyProxyOwner {
function claimTokens(address _token, address _to) public onlyIfOwnerOfProxy {
require(_token != address(erc20token()));
super.claimTokens(_token, _to);
}

View File

@ -44,7 +44,7 @@ contract ForeignBridgeErcToNative is BasicBridge, BasicForeignBridge {
return bytes4(keccak256(abi.encodePacked("erc-to-native-core")));
}
function claimTokens(address _token, address _to) public onlyProxyOwner {
function claimTokens(address _token, address _to) public onlyIfOwnerOfProxy {
require(_token != address(erc20token()));
super.claimTokens(_token, _to);
}

View File

@ -45,7 +45,7 @@ contract ForeignBridgeNativeToErc is ERC677Receiver, BasicBridge, BasicForeignBr
return bytes4(keccak256(abi.encodePacked("native-to-erc-core")));
}
function claimTokensFromErc677(address _token, address _to) external onlyProxyOwner {
function claimTokensFromErc677(address _token, address _to) external onlyIfOwnerOfProxy {
erc677token().claimTokens(_token, _to);
}