Skip to content

Commit a5b1696

Browse files
committed
chain bridge gateways removed return value
1 parent 86a31d0 commit a5b1696

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

contracts/base-chain/bridge-gateways/AMPLChainBridgeGateway.sol

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
55
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
66

77
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
8-
import {IAmpleforthPolicy} from "../../_interfaces/IAmpleforthPolicy.sol";
8+
import {IAmpleforth} from "../../_interfaces/IAmpleforth.sol";
99
import {ITokenVault} from "../../_interfaces/ITokenVault.sol";
1010
import {IBridgeGateway} from "../../_interfaces/IBridgeGateway.sol";
1111

@@ -51,9 +51,8 @@ contract AMPLChainBridgeGateway is IBridgeGateway, Ownable {
5151
function validateRebaseReport(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)
5252
external
5353
onlyOwner
54-
returns (bool)
5554
{
56-
uint256 recordedGlobalAmpleforthEpoch = IAmpleforthPolicy(policy).epoch();
55+
uint256 recordedGlobalAmpleforthEpoch = IAmpleforth(policy).epoch();
5756
uint256 recordedGlobalAMPLSupply = IERC20(ampl).totalSupply();
5857

5958
require(
@@ -66,8 +65,6 @@ contract AMPLChainBridgeGateway is IBridgeGateway, Ownable {
6665
);
6766

6867
emit XCRebaseReportOut(globalAmpleforthEpoch, globalAMPLSupply);
69-
70-
return true;
7168
}
7269

7370
/**
@@ -83,7 +80,7 @@ contract AMPLChainBridgeGateway is IBridgeGateway, Ownable {
8380
address recipientAddressInTargetChain,
8481
uint256 amount,
8582
uint256 globalAMPLSupply
86-
) external onlyOwner returns (bool) {
83+
) external onlyOwner {
8784
uint256 recordedGlobalAMPLSupply = IERC20(ampl).totalSupply();
8885

8986
require(
@@ -94,8 +91,6 @@ contract AMPLChainBridgeGateway is IBridgeGateway, Ownable {
9491
ITokenVault(vault).lock(ampl, sender, amount);
9592

9693
emit XCTransferOut(sender, amount, recordedGlobalAMPLSupply);
97-
98-
return true;
9994
}
10095

10196
/**
@@ -111,15 +106,13 @@ contract AMPLChainBridgeGateway is IBridgeGateway, Ownable {
111106
address recipient,
112107
uint256 amount,
113108
uint256 globalAMPLSupply
114-
) external onlyOwner returns (bool) {
109+
) external onlyOwner {
115110
uint256 recordedGlobalAMPLSupply = IERC20(ampl).totalSupply();
116111
uint256 unlockAmount = amount.mul(recordedGlobalAMPLSupply).div(globalAMPLSupply);
117112

118113
emit XCTransferIn(recipient, globalAMPLSupply, unlockAmount, recordedGlobalAMPLSupply);
119114

120115
ITokenVault(vault).unlock(ampl, recipient, unlockAmount);
121-
122-
return true;
123116
}
124117

125118
constructor(

contracts/satellite-chain/bridge-gateways/ChainBridgeXCAmpleGateway.sol

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
66

77
import {IBridgeGateway} from "../../_interfaces/IBridgeGateway.sol";
88
import {IXCAmpleController} from "../../_interfaces/IXCAmpleController.sol";
9+
import {IXCAmpleControllerGateway} from "../../_interfaces/IXCAmpleControllerGateway.sol";
910
import {IXCAmple} from "../../_interfaces/IXCAmple.sol";
1011

1112
/**
@@ -45,7 +46,6 @@ contract ChainBridgeXCAmpleGateway is IBridgeGateway, Ownable {
4546
function reportRebase(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)
4647
external
4748
onlyOwner
48-
returns (bool)
4949
{
5050
uint256 recordedGlobalAmpleforthEpoch = IXCAmpleController(xcController)
5151
.globalAmpleforthEpoch();
@@ -59,9 +59,10 @@ contract ChainBridgeXCAmpleGateway is IBridgeGateway, Ownable {
5959
recordedGlobalAMPLSupply
6060
);
6161

62-
IXCAmpleController(xcController).reportRebase(globalAmpleforthEpoch, globalAMPLSupply);
63-
64-
return true;
62+
IXCAmpleControllerGateway(xcController).reportRebase(
63+
globalAmpleforthEpoch,
64+
globalAMPLSupply
65+
);
6566
}
6667

6768
/**
@@ -78,15 +79,13 @@ contract ChainBridgeXCAmpleGateway is IBridgeGateway, Ownable {
7879
address recipient,
7980
uint256 amount,
8081
uint256 globalAMPLSupply
81-
) external onlyOwner returns (bool) {
82+
) external onlyOwner {
8283
uint256 recordedGlobalAMPLSupply = IXCAmple(xcAmple).globalAMPLSupply();
8384
uint256 mintAmount = amount.mul(recordedGlobalAMPLSupply).div(globalAMPLSupply);
8485

8586
emit XCTransferIn(recipient, globalAMPLSupply, mintAmount, recordedGlobalAMPLSupply);
8687

87-
IXCAmpleController(xcController).mint(recipient, mintAmount);
88-
89-
return true;
88+
IXCAmpleControllerGateway(xcController).mint(recipient, mintAmount);
9089
}
9190

9291
/**
@@ -101,18 +100,16 @@ contract ChainBridgeXCAmpleGateway is IBridgeGateway, Ownable {
101100
address recipientAddressInTargetChain,
102101
uint256 amount,
103102
uint256 globalAMPLSupply
104-
) external onlyOwner returns (bool) {
103+
) external onlyOwner {
105104
uint256 recordedGlobalAMPLSupply = IXCAmple(xcAmple).globalAMPLSupply();
106105
require(
107106
globalAMPLSupply == recordedGlobalAMPLSupply,
108107
"ChainBridgeXCAmpleGateway: total supply not consistent"
109108
);
110109

111-
IXCAmpleController(xcController).burn(sender, amount);
110+
IXCAmpleControllerGateway(xcController).burn(sender, amount);
112111

113112
emit XCTransferOut(sender, amount, recordedGlobalAMPLSupply);
114-
115-
return true;
116113
}
117114

118115
constructor(

0 commit comments

Comments
 (0)