Skip to content

Commit 732e010

Browse files
committed
updated totalUnderlying and ran linter
1 parent d95968e commit 732e010

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

contracts/WAMPL.sol

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ contract WAMPL is ERC20, ERC20Permit {
3232
// Constants
3333

3434
/// @dev The maximum wAMPL supply.
35-
uint256 public constant MAX_WAMPL_SUPPLY = 10000000 * (10**18); // 10 M
35+
uint256 public constant MAX_WAMPL_SUPPLY = 10000000 * (10**18); // 10 M
3636

3737
//--------------------------------------------------------------------------
3838
// Attributes
@@ -158,7 +158,7 @@ contract WAMPL is ERC20, ERC20Permit {
158158

159159
/// @return The total AMPLs held by this contract.
160160
function totalUnderlying() external view returns (uint256) {
161-
return _queryUnderlyingBalance();
161+
return _wampleToAmple(totalSupply(), _queryAMPLSupply());
162162
}
163163

164164
/// @param owner The account address.
@@ -187,11 +187,6 @@ contract WAMPL is ERC20, ERC20Permit {
187187
return IERC20(_ampl).totalSupply();
188188
}
189189

190-
/// @dev Queries the AMPL balance of this contract.
191-
function _queryUnderlyingBalance() private view returns (uint256) {
192-
return IERC20(_ampl).balanceOf(address(this));
193-
}
194-
195190
//--------------------------------------------------------------------------
196191
// Pure methods
197192

hardhat.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,22 @@ export default {
2121
rinkeby: {
2222
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_SECRET}`,
2323
accounts: {
24-
mnemonic: process.env.DEV_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
24+
mnemonic:
25+
process.env.DEV_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
2526
},
2627
},
2728
kovan: {
2829
url: `https://kovan.infura.io/v3/${process.env.INFURA_SECRET}`,
2930
accounts: {
30-
mnemonic: process.env.DEV_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
31+
mnemonic:
32+
process.env.DEV_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
3133
},
3234
},
3335
mainnet: {
3436
url: `https://mainnet.infura.io/v3/${process.env.INFURA_SECRET}`,
3537
accounts: {
36-
mnemonic: process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
38+
mnemonic:
39+
process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
3740
},
3841
},
3942
},

0 commit comments

Comments
 (0)