Make refund and reward addresses `payable`.
This commit is contained in:
parent
9acc9fcbd6
commit
a5427bb177
|
@ -26,7 +26,7 @@ interface IRelayProvider {
|
||||||
//Otherwise, the delivery on the target chain (msg.sender) must equal this address.
|
//Otherwise, the delivery on the target chain (msg.sender) must equal this address.
|
||||||
function getDeliveryAddress(uint16 targetChain) external view returns (bytes32 whAddress);
|
function getDeliveryAddress(uint16 targetChain) external view returns (bytes32 whAddress);
|
||||||
|
|
||||||
function getRewardAddress() external view returns (address rewardAddress);
|
function getRewardAddress() external view returns (address payable rewardAddress);
|
||||||
|
|
||||||
function getConsistencyLevel() external view returns (uint8 consistencyLevel);
|
function getConsistencyLevel() external view returns (uint8 consistencyLevel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ contract RelayProvider is RelayProviderGovernance, IRelayProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns the address on this chain that rewards should be sent to
|
//Returns the address on this chain that rewards should be sent to
|
||||||
function getRewardAddress() public view override returns (address) {
|
function getRewardAddress() public view override returns (address payable) {
|
||||||
return rewardAddress();
|
return rewardAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ contract RelayProviderGetters is RelayProviderState {
|
||||||
return _state.wormholeFee[targetChainId];
|
return _state.wormholeFee[targetChainId];
|
||||||
}
|
}
|
||||||
|
|
||||||
function rewardAddress() public view returns (address) {
|
function rewardAddress() public view returns (address payable) {
|
||||||
return _state.rewardAddress;
|
return _state.rewardAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ abstract contract RelayProviderGovernance is RelayProviderGetters, RelayProvider
|
||||||
emit ApprovedSenderUpdated(sender, approved);
|
emit ApprovedSenderUpdated(sender, approved);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRewardAddress(address newAddress) public onlyOwner {
|
function updateRewardAddress(address payable newAddress) public onlyOwner {
|
||||||
setRewardAddress(newAddress);
|
setRewardAddress(newAddress);
|
||||||
emit RewardAddressUpdated(newAddress);
|
emit RewardAddressUpdated(newAddress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ contract RelayProviderSetters is Context, RelayProviderState {
|
||||||
_state.wormholeFee[chainId] = wormholeFee;
|
_state.wormholeFee[chainId] = wormholeFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRewardAddress(address rewardAddress) internal {
|
function setRewardAddress(address payable rewardAddress) internal {
|
||||||
_state.rewardAddress = rewardAddress;
|
_state.rewardAddress = rewardAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ contract RelayProviderStorage {
|
||||||
// Dictionary of wormhole chain id -> assetConversionBufferDenominator
|
// Dictionary of wormhole chain id -> assetConversionBufferDenominator
|
||||||
mapping(uint16 => uint16) assetConversionBufferDenominator;
|
mapping(uint16 => uint16) assetConversionBufferDenominator;
|
||||||
// Reward address for the relayer. The CoreRelayer contract transfers the reward for relaying messages here.
|
// Reward address for the relayer. The CoreRelayer contract transfers the reward for relaying messages here.
|
||||||
address rewardAddress;
|
address payable rewardAddress;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,8 +220,8 @@ contract TestCoreRelayer is Test {
|
||||||
CoreRelayer coreRelayerFull;
|
CoreRelayer coreRelayerFull;
|
||||||
MockRelayerIntegration integration;
|
MockRelayerIntegration integration;
|
||||||
address relayer;
|
address relayer;
|
||||||
address rewardAddress;
|
address payable rewardAddress;
|
||||||
address refundAddress;
|
address payable refundAddress;
|
||||||
uint16 chainId;
|
uint16 chainId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,8 +236,10 @@ contract TestCoreRelayer is Test {
|
||||||
mapEntry.coreRelayerFull = CoreRelayer(address(mapEntry.coreRelayer));
|
mapEntry.coreRelayerFull = CoreRelayer(address(mapEntry.coreRelayer));
|
||||||
mapEntry.integration = new MockRelayerIntegration(address(mapEntry.wormhole), address(mapEntry.coreRelayer));
|
mapEntry.integration = new MockRelayerIntegration(address(mapEntry.wormhole), address(mapEntry.coreRelayer));
|
||||||
mapEntry.relayer = address(uint160(uint256(keccak256(abi.encodePacked(bytes("relayer"), i)))));
|
mapEntry.relayer = address(uint160(uint256(keccak256(abi.encodePacked(bytes("relayer"), i)))));
|
||||||
mapEntry.refundAddress = address(uint160(uint256(keccak256(abi.encodePacked(bytes("refundAddress"), i)))));
|
mapEntry.refundAddress =
|
||||||
mapEntry.rewardAddress = address(uint160(uint256(keccak256(abi.encodePacked(bytes("rewardAddress"), i)))));
|
payable(address(uint160(uint256(keccak256(abi.encodePacked(bytes("refundAddress"), i))))));
|
||||||
|
mapEntry.rewardAddress =
|
||||||
|
payable(address(uint160(uint256(keccak256(abi.encodePacked(bytes("rewardAddress"), i))))));
|
||||||
mapEntry.chainId = i;
|
mapEntry.chainId = i;
|
||||||
map[i] = mapEntry;
|
map[i] = mapEntry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue