Skip to content

Commit ddf1e1b

Browse files
committed
ran linter
1 parent dc6b8ef commit ddf1e1b

File tree

13 files changed

+140
-187
lines changed

13 files changed

+140
-187
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ module.exports = {
156156
'matic',
157157
'dev1',
158158
'dev2',
159+
'avax',
159160

160161
// names
161162
'nithin',

contracts/_mocks/MockRebaseRelayer.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
pragma solidity 0.7.3;
33

44
contract MockRebaseRelayer {
5-
enum State {Failure, Revert, Success}
5+
enum State {
6+
Failure,
7+
Revert,
8+
Success
9+
}
610
State private state;
711

812
function executeAll() external view returns (bool) {

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

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

77
import {ChainBridgeRebaseGateway} from "../../base-bridge-gateways/ChainBridgeRebaseGateway.sol";
8-
import {
9-
ChainBridgeTransferGateway
10-
} from "../../base-bridge-gateways/ChainBridgeTransferGateway.sol";
8+
import {ChainBridgeTransferGateway} from "../../base-bridge-gateways/ChainBridgeTransferGateway.sol";
119

1210
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
1311
import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol";

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

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

77
import {ChainBridgeRebaseGateway} from "../../base-bridge-gateways/ChainBridgeRebaseGateway.sol";
8-
import {
9-
ChainBridgeTransferGateway
10-
} from "../../base-bridge-gateways/ChainBridgeTransferGateway.sol";
8+
import {ChainBridgeTransferGateway} from "../../base-bridge-gateways/ChainBridgeTransferGateway.sol";
119

1210
import {IXCAmpleController} from "../../_interfaces/IXCAmpleController.sol";
1311
import {IXCAmpleControllerGateway} from "../../_interfaces/IXCAmpleControllerGateway.sol";

contracts/satellite-chain/xc-ampleforth/XCAmple.sol

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
22
pragma solidity 0.7.3;
33

4-
import {
5-
SafeMathUpgradeable
6-
} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
7-
import {
8-
IERC20Upgradeable
9-
} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
10-
import {
11-
OwnableUpgradeable
12-
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4+
import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
5+
import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
6+
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
137

148
/**
159
* @title XC(cross-chain)Ample ERC20 token
@@ -79,12 +73,14 @@ contract XCAmple is IERC20Upgradeable, OwnableUpgradeable {
7973
// EIP-2612: permit – 712-signed approvals
8074
// https://eips.ethereum.org/EIPS/eip-2612
8175
string public constant EIP712_REVISION = "1";
82-
bytes32 public constant EIP712_DOMAIN = keccak256(
83-
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
84-
);
85-
bytes32 public constant PERMIT_TYPEHASH = keccak256(
86-
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
87-
);
76+
bytes32 public constant EIP712_DOMAIN =
77+
keccak256(
78+
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
79+
);
80+
bytes32 public constant PERMIT_TYPEHASH =
81+
keccak256(
82+
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
83+
);
8884

8985
// EIP-2612: keeps track of number of permits per address
9086
mapping(address => uint256) private _nonces;

contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
22
pragma solidity 0.7.3;
33

4-
import {
5-
SafeMathUpgradeable
6-
} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
7-
import {
8-
SignedSafeMathUpgradeable
9-
} from "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";
10-
import {
11-
OwnableUpgradeable
12-
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
4+
import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
5+
import {SignedSafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";
6+
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
137

148
import {UInt256Lib} from "./UInt256Lib.sol";
159
import {IXCAmple} from "../../_interfaces/IXCAmple.sol";

helpers/deploy.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ async function deployChainBridgeBaseChainGatewayContracts(
248248
const adminRole = await bridge.DEFAULT_ADMIN_ROLE();
249249
const isAdmin = await bridge.hasRole(adminRole, deployerAddress);
250250

251-
const reportRebaseFnSig = CB_FUNCTION_SIG_baseChainReportRebase(
252-
rebaseGateway,
253-
);
251+
const reportRebaseFnSig =
252+
CB_FUNCTION_SIG_baseChainReportRebase(rebaseGateway);
254253

255254
if (isAdmin) {
256255
await (
@@ -356,9 +355,8 @@ async function deployChainBridgeSatelliteChainGatewayContracts(
356355
const adminRole = await bridge.DEFAULT_ADMIN_ROLE();
357356
const isAdmin = await bridge.hasRole(adminRole, await deployer.getAddress());
358357

359-
const reportRebaseFnSig = CB_FUNCTION_SIG_satelliteChainReportRebase(
360-
rebaseGateway,
361-
);
358+
const reportRebaseFnSig =
359+
CB_FUNCTION_SIG_satelliteChainReportRebase(rebaseGateway);
362360
if (isAdmin) {
363361
await (
364362
await bridge.adminSetGenericResource(

tasks/deploy/ampleforth.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,8 @@ txTask('testnet:deploy:ampleforth', 'Deploy ampleforth contract suite')
102102
console.log('Deploying contracts on base-chain');
103103
console.log('Deployer:', deployerAddress);
104104

105-
const {
106-
proxyAdmin,
107-
ampl,
108-
policy,
109-
orchestrator,
110-
rateOracle,
111-
cpiOracle,
112-
} = await deployAMPLContracts(hre.ethers, deployer, txParams);
105+
const { proxyAdmin, ampl, policy, orchestrator, rateOracle, cpiOracle } =
106+
await deployAMPLContracts(hre.ethers, deployer, txParams);
113107
for (const w in args.fundingWallets) {
114108
await ampl.transfer(args.fundingWallets[w], toAmplFixedPt(args.amount));
115109
}
@@ -172,24 +166,18 @@ txTask('deploy:ampleforth_xc', 'Deploy cross chain ampleforth contract suite')
172166
baseChainProvider,
173167
);
174168
await printRebaseInfo(baseChainPolicy);
175-
const [
176-
globalAmpleforthEpoch,
177-
globalAMPLSupply,
178-
] = await baseChainPolicy.globalAmpleforthEpochAndAMPLSupply();
169+
const [globalAmpleforthEpoch, globalAMPLSupply] =
170+
await baseChainPolicy.globalAmpleforthEpochAndAMPLSupply();
179171

180172
console.log('------------------------------------------------------------');
181173
console.log('Deploying Contracts on satellite-chain');
182-
const {
183-
proxyAdmin,
184-
xcAmple,
185-
xcAmpleController,
186-
rebaseRelayer,
187-
} = await deployXCAmpleContracts(
188-
{ ...args, globalAmpleforthEpoch, globalAMPLSupply },
189-
hre.ethers,
190-
deployer,
191-
txParams,
192-
);
174+
const { proxyAdmin, xcAmple, xcAmpleController, rebaseRelayer } =
175+
await deployXCAmpleContracts(
176+
{ ...args, globalAmpleforthEpoch, globalAMPLSupply },
177+
hre.ethers,
178+
deployer,
179+
txParams,
180+
);
193181

194182
console.log('------------------------------------------------------------');
195183
console.log('Writing data to file');

tasks/deploy/chain_bridge.js

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,19 @@ cbDeployTask(
131131
txParams,
132132
);
133133

134-
const {
135-
rebaseGateway,
136-
transferGateway,
137-
} = await deployChainBridgeBaseChainGatewayContracts(
138-
{
139-
bridge,
140-
genericHandler,
141-
ampl,
142-
policy,
143-
tokenVault,
144-
},
145-
hre.ethers,
146-
deployer,
147-
txParams,
148-
);
134+
const { rebaseGateway, transferGateway } =
135+
await deployChainBridgeBaseChainGatewayContracts(
136+
{
137+
bridge,
138+
genericHandler,
139+
ampl,
140+
policy,
141+
tokenVault,
142+
},
143+
hre.ethers,
144+
deployer,
145+
txParams,
146+
);
149147

150148
console.log('------------------------------------------------------------');
151149
console.log('Writing data to file');
@@ -259,15 +257,13 @@ cbDeployTask(
259257
hre.ethers.provider,
260258
);
261259

262-
const {
263-
rebaseGateway,
264-
transferGateway,
265-
} = await deployChainBridgeSatelliteChainGatewayContracts(
266-
{ xcAmple, xcAmpleController, bridge, genericHandler },
267-
hre.ethers,
268-
deployer,
269-
txParams,
270-
);
260+
const { rebaseGateway, transferGateway } =
261+
await deployChainBridgeSatelliteChainGatewayContracts(
262+
{ xcAmple, xcAmpleController, bridge, genericHandler },
263+
hre.ethers,
264+
deployer,
265+
txParams,
266+
);
271267

272268
console.log('------------------------------------------------------------');
273269
console.log('Writing data to file');
@@ -362,9 +358,8 @@ txTask(
362358
// Base chain
363359
const adminRole = await bridge.DEFAULT_ADMIN_ROLE();
364360
const isAdmin = await bridge.hasRole(adminRole, deployerAddress);
365-
const reportRebaseFnSig = CB_FUNCTION_SIG_baseChainReportRebase(
366-
rebaseGateway,
367-
);
361+
const reportRebaseFnSig =
362+
CB_FUNCTION_SIG_baseChainReportRebase(rebaseGateway);
368363
const transferFnSig = CB_FUNCTION_SIG_baseChainTransfer(transferGateway);
369364

370365
if (isAdmin) {
@@ -439,12 +434,10 @@ txTask(
439434
);
440435
const adminRole = await bridge.DEFAULT_ADMIN_ROLE();
441436
const isAdmin = await bridge.hasRole(adminRole, deployerAddress);
442-
const reportRebaseFnSig = CB_FUNCTION_SIG_satelliteChainReportRebase(
443-
rebaseGateway,
444-
);
445-
const transferFnSig = CB_FUNCTION_SIG_satelliteChainTransfer(
446-
transferGateway,
447-
);
437+
const reportRebaseFnSig =
438+
CB_FUNCTION_SIG_satelliteChainReportRebase(rebaseGateway);
439+
const transferFnSig =
440+
CB_FUNCTION_SIG_satelliteChainTransfer(transferGateway);
448441

449442
if (isAdmin) {
450443
await (

tasks/deploy/matic.js

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,19 @@ txTask(
5656
hre.ethers.provider,
5757
);
5858

59-
const {
60-
rebaseGateway,
61-
transferGateway,
62-
} = await deployMaticBaseChainGatewayContracts(
63-
{
64-
ampl,
65-
policy,
66-
tokenVault,
67-
checkpointManagerAddress: args.checkpointManager,
68-
fxRootAddress: args.fxRoot,
69-
},
70-
hre.ethers,
71-
deployer,
72-
txParams,
73-
);
59+
const { rebaseGateway, transferGateway } =
60+
await deployMaticBaseChainGatewayContracts(
61+
{
62+
ampl,
63+
policy,
64+
tokenVault,
65+
checkpointManagerAddress: args.checkpointManager,
66+
fxRootAddress: args.fxRoot,
67+
},
68+
hre.ethers,
69+
deployer,
70+
txParams,
71+
);
7472

7573
console.log('------------------------------------------------------------');
7674
console.log('Writing data to file');
@@ -132,15 +130,13 @@ txTask(
132130
hre.ethers.provider,
133131
);
134132

135-
const {
136-
rebaseGateway,
137-
transferGateway,
138-
} = await deployMaticSatelliteChainGatewayContracts(
139-
{ xcAmple, xcAmpleController, fxChildAddress: args.fxChild },
140-
hre.ethers,
141-
deployer,
142-
txParams,
143-
);
133+
const { rebaseGateway, transferGateway } =
134+
await deployMaticSatelliteChainGatewayContracts(
135+
{ xcAmple, xcAmpleController, fxChildAddress: args.fxChild },
136+
hre.ethers,
137+
deployer,
138+
txParams,
139+
);
144140

145141
console.log('------------------------------------------------------------');
146142
console.log('Writing data to file');

0 commit comments

Comments
 (0)