Added upgradeability tests

This commit is contained in:
The3D 2020-08-10 20:20:08 +02:00
parent 734d125cd7
commit b387bcf845
56 changed files with 3887 additions and 2517 deletions

4
.gitignore vendored
View File

@ -11,4 +11,6 @@ build/
coverage coverage
.coverage_artifacts .coverage_artifacts
.coverage_cache .coverage_cache
.coverage_contracts .coverage_contracts
types/

View File

@ -10,7 +10,7 @@ usePlugin('buidler-typechain');
usePlugin('solidity-coverage'); usePlugin('solidity-coverage');
usePlugin('@nomiclabs/buidler-waffle'); usePlugin('@nomiclabs/buidler-waffle');
usePlugin('@nomiclabs/buidler-etherscan'); usePlugin('@nomiclabs/buidler-etherscan');
usePlugin('buidler-gas-reporter'); //usePlugin('buidler-gas-reporter');
['misc'].forEach((folder) => { ['misc'].forEach((folder) => {
const tasksPath = path.join(__dirname, 'tasks', folder); const tasksPath = path.join(__dirname, 'tasks', folder);

View File

@ -10,6 +10,7 @@ import '../configuration/LendingPoolAddressesProvider.sol';
import '../libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol'; import '../libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol';
import {LendingPool} from './LendingPool.sol'; import {LendingPool} from './LendingPool.sol';
import {IERC20Detailed} from '../interfaces/IERC20Detailed.sol'; import {IERC20Detailed} from '../interfaces/IERC20Detailed.sol';
import '@nomiclabs/buidler/console.sol';
/** /**
* @title LendingPoolConfigurator contract * @title LendingPoolConfigurator contract
@ -211,10 +212,15 @@ contract LendingPoolConfigurator is VersionedInitializable {
emit ReserveInitialized(_reserve, address(aTokenProxy), _interestRateStrategyAddress); emit ReserveInitialized(_reserve, address(aTokenProxy), _interestRateStrategyAddress);
} }
/**
* @dev updates the aToken implementation for the _reserve
* @param _reserve the address of the reserve to be updated
* @param _implementation the address of the new aToken implementation
**/
function updateAToken(address _reserve, address _implementation) external onlyLendingPoolManager { function updateAToken(address _reserve, address _implementation) external onlyLendingPoolManager {
(address aTokenAddress, , ) = pool.getReserveTokensAddresses(_reserve); (address aTokenAddress, , ) = pool.getReserveTokensAddresses(_reserve);
uint8 decimals = IERC20Detailed(aTokenAddress).decimals(); (uint256 decimals, , , , , , , , , ) = pool.getReserveConfigurationData(_reserve);
InitializableAdminUpgradeabilityProxy aTokenProxy = InitializableAdminUpgradeabilityProxy( InitializableAdminUpgradeabilityProxy aTokenProxy = InitializableAdminUpgradeabilityProxy(
payable(aTokenAddress) payable(aTokenAddress)
@ -222,9 +228,9 @@ contract LendingPoolConfigurator is VersionedInitializable {
bytes memory params = abi.encodeWithSignature( bytes memory params = abi.encodeWithSignature(
'initialize(uint8,string,string)', 'initialize(uint8,string,string)',
decimals, uint8(decimals),
IERC20Detailed(aTokenAddress).name(), IERC20Detailed(_implementation).name(),
IERC20Detailed(aTokenAddress).symbol() IERC20Detailed(_implementation).symbol()
); );
aTokenProxy.upgradeToAndCall(_implementation, params); aTokenProxy.upgradeToAndCall(_implementation, params);

View File

@ -59,7 +59,6 @@ library ReserveLogic {
uint40 lastUpdateTimestamp; uint40 lastUpdateTimestamp;
// isStableBorrowRateEnabled = true means users can borrow at a stable rate // isStableBorrowRateEnabled = true means users can borrow at a stable rate
bool isStableBorrowRateEnabled; bool isStableBorrowRateEnabled;
uint8 index; uint8 index;
} }
@ -72,8 +71,10 @@ library ReserveLogic {
**/ **/
function getNormalizedIncome(ReserveData storage _reserve) internal view returns (uint256) { function getNormalizedIncome(ReserveData storage _reserve) internal view returns (uint256) {
uint40 timestamp = _reserve.lastUpdateTimestamp; uint40 timestamp = _reserve.lastUpdateTimestamp;
if(timestamp == uint40(block.timestamp)) { //if the index was updated in the same block, no need to perform any calculation //solium-disable-next-line
if (timestamp == uint40(block.timestamp)) {
//if the index was updated in the same block, no need to perform any calculation
return _reserve.lastLiquidityCumulativeIndex; return _reserve.lastLiquidityCumulativeIndex;
} }
@ -92,10 +93,11 @@ library ReserveLogic {
* @return the normalized variable debt. expressed in ray * @return the normalized variable debt. expressed in ray
**/ **/
function getNormalizedDebt(ReserveData storage _reserve) internal view returns (uint256) { function getNormalizedDebt(ReserveData storage _reserve) internal view returns (uint256) {
uint40 timestamp = _reserve.lastUpdateTimestamp; uint40 timestamp = _reserve.lastUpdateTimestamp;
if(timestamp == uint40(block.timestamp)) { //if the index was updated in the same block, no need to perform any calculation //solium-disable-next-line
if (timestamp == uint40(block.timestamp)) {
//if the index was updated in the same block, no need to perform any calculation
return _reserve.lastVariableBorrowCumulativeIndex; return _reserve.lastVariableBorrowCumulativeIndex;
} }

View File

@ -0,0 +1,28 @@
pragma solidity ^0.6.8;
import {AToken} from '../../tokenization/AToken.sol';
import {LendingPool} from '../../lendingpool/LendingPool.sol';
import '@nomiclabs/buidler/console.sol';
contract MockAToken is AToken {
constructor(
LendingPool _pool,
address _underlyingAssetAddress,
string memory _tokenName,
string memory _tokenSymbol
) public AToken(_pool, _underlyingAssetAddress, _tokenName, _tokenSymbol) {}
function getRevision() internal override pure returns (uint256) {
return 0x2;
}
function initialize(
uint8 _underlyingAssetDecimals,
string calldata _tokenName,
string calldata _tokenSymbol
) external virtual override initializer {
_name = _tokenName;
_symbol = _tokenSymbol;
_setupDecimals(_underlyingAssetDecimals);
}
}

View File

@ -151,7 +151,7 @@ contract AToken is VersionedInitializable, ERC20 {
underlyingAssetAddress = _underlyingAssetAddress; underlyingAssetAddress = _underlyingAssetAddress;
} }
function getRevision() internal override pure returns (uint256) { function getRevision() internal virtual override pure returns (uint256) {
return ATOKEN_REVISION; return ATOKEN_REVISION;
} }
@ -159,7 +159,7 @@ contract AToken is VersionedInitializable, ERC20 {
uint8 _underlyingAssetDecimals, uint8 _underlyingAssetDecimals,
string calldata _tokenName, string calldata _tokenName,
string calldata _tokenSymbol string calldata _tokenSymbol
) external initializer { ) external virtual initializer {
_name = _tokenName; _name = _tokenName;
_symbol = _tokenSymbol; _symbol = _tokenSymbol;
_setupDecimals(_underlyingAssetDecimals); _setupDecimals(_underlyingAssetDecimals);
@ -465,12 +465,7 @@ contract AToken is VersionedInitializable, ERC20 {
} }
//updates the user index //updates the user index
uint256 index = userIndexes[_user] = pool.getReserveNormalizedIncome(underlyingAssetAddress); uint256 index = userIndexes[_user] = pool.getReserveNormalizedIncome(underlyingAssetAddress);
return ( return (previousBalance, currBalance, balanceIncrease, index);
previousBalance,
currBalance,
balanceIncrease,
index
);
} }
/** /**

View File

@ -447,5 +447,11 @@
"address": "0xd4e934C2749CA8C1618659D02E7B28B074bf4df7", "address": "0xd4e934C2749CA8C1618659D02E7B28B074bf4df7",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
} }
},
"MockAToken": {
"buidlerevm": {
"address": "0xccdf1DECe9c9631081b952Cd51A579E75c33C565",
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
}
} }
} }

View File

@ -77,7 +77,7 @@ export const getCurrentBlock = async () => {
export const decodeAbiNumber = (data: string): number => export const decodeAbiNumber = (data: string): number =>
parseInt(utils.defaultAbiCoder.decode(['uint256'], data).toString()); parseInt(utils.defaultAbiCoder.decode(['uint256'], data).toString());
const deployContract = async <ContractType extends Contract>( export const deployContract = async <ContractType extends Contract>(
contractName: string, contractName: string,
args: any[] args: any[]
): Promise<ContractType> => { ): Promise<ContractType> => {
@ -282,18 +282,22 @@ export const deployVariableDebtToken = async ([
return token; return token;
}; };
export const deployGenericAToken = async ([ export const deployGenericAToken = async ([poolAddress, underlyingAssetAddress, name, symbol]: [
poolAddress, tEthereumAddress,
underlyingAssetAddress, tEthereumAddress,
name, string,
symbol string
]: [ tEthereumAddress, tEthereumAddress, string, string]) => { ]) => {
const token = await deployContract<AToken>(eContractid.AToken, [poolAddress, underlyingAssetAddress, name, symbol]); const token = await deployContract<AToken>(eContractid.AToken, [
poolAddress,
underlyingAssetAddress,
name,
symbol,
]);
return token; return token;
}; };
export const getLendingPoolAddressesProvider = async (address?: tEthereumAddress) => { export const getLendingPoolAddressesProvider = async (address?: tEthereumAddress) => {
return await getContract<LendingPoolAddressesProvider>( return await getContract<LendingPoolAddressesProvider>(
eContractid.LendingPoolAddressesProvider, eContractid.LendingPoolAddressesProvider,

View File

@ -37,6 +37,7 @@ export enum eContractid {
MockFlashLoanReceiver = 'MockFlashLoanReceiver', MockFlashLoanReceiver = 'MockFlashLoanReceiver',
WalletBalanceProvider = 'WalletBalanceProvider', WalletBalanceProvider = 'WalletBalanceProvider',
AToken = 'AToken', AToken = 'AToken',
MockAToken = 'MockAToken',
AaveProtocolTestHelpers = 'AaveProtocolTestHelpers', AaveProtocolTestHelpers = 'AaveProtocolTestHelpers',
IERC20Detailed = 'IERC20Detailed', IERC20Detailed = 'IERC20Detailed',
StableDebtToken = 'StableDebtToken', StableDebtToken = 'StableDebtToken',

View File

@ -1,134 +1,42 @@
// import {ContractId, ITestEnvWithoutInstances} from '../utils/types'; import {expect} from 'chai';
// import { import {makeSuite, TestEnv} from './helpers/make-suite';
// LendingPoolCoreInstance, import {ProtocolErrors, eContractid} from '../helpers/types';
// LendingPoolConfiguratorInstance, import {deployGenericAToken, getAToken, deployContract} from '../helpers/contracts-helpers';
// LendingPoolAddressesProviderInstance, import {MockAToken} from '../types/MockAToken';
// LendingPoolDataProviderInstance,
// LendingPoolInstance,
// MockLendingPoolCoreInstance,
// } from '../utils/typechain-types/truffle-contracts';
// import {testEnvProviderWithoutInstances} from '../utils/truffle/dlp-tests-env';
// import {ETHEREUM_ADDRESS} from '../utils/constants';
// import {getTruffleContractInstance} from '../utils/truffle/truffle-core-utils';
// import BN = require('bn.js');
// const {expectEvent, expectRevert} = require('@openzeppelin/test-helpers'); makeSuite('Upgradeability', (testEnv: TestEnv) => {
const {INVALID_POOL_MANAGER_CALLER_MSG} = ProtocolErrors;
let newATokenAddress: string;
// contract('Upgradeability', async ([deployer, ...users]) => { before('deploying instances', async () => {
// let _testEnvProvider: ITestEnvWithoutInstances; const {dai, pool} = testEnv;
// let _configuratorInstance: LendingPoolConfiguratorInstance; const aTokenInstance = await deployContract<MockAToken>(eContractid.MockAToken, [
// let _coreInstance: LendingPoolCoreInstance; pool.address,
// let _poolInstance: LendingPoolInstance; dai.address,
// let _addressesProviderInstance: LendingPoolAddressesProviderInstance; 'Aave Interest bearing DAI updated',
// let _dataProviderInstance: LendingPoolDataProviderInstance; 'aDAI',
// let _mockCoreInstance: MockLendingPoolCoreInstance; ]);
// before('Initializing test variables', async () => { newATokenAddress = aTokenInstance.address;
// _testEnvProvider = await testEnvProviderWithoutInstances(artifacts, [deployer, ...users]); });
// const { it('Tries to update the DAI Atoken implementation with a different address than the lendingPoolManager', async () => {
// getLendingPoolAddressesProviderInstance, const {dai, configurator, users} = testEnv;
// getLendingPoolConfiguratorInstance,
// getLendingPoolCoreInstance,
// getLendingPoolDataProviderInstance,
// getLendingPoolInstance,
// } = _testEnvProvider;
// const instances = await Promise.all([ await expect(
// getLendingPoolAddressesProviderInstance(), configurator.connect(users[1].signer).updateAToken(dai.address, newATokenAddress)
// getLendingPoolConfiguratorInstance(), ).to.be.revertedWith(INVALID_POOL_MANAGER_CALLER_MSG);
// getLendingPoolCoreInstance(), });
// getLendingPoolDataProviderInstance(),
// getLendingPoolInstance(),
// ]);
// _addressesProviderInstance = instances[0]; it('Upgrades the DAI Atoken implementation ', async () => {
// _configuratorInstance = instances[1]; const {dai, configurator, aDai} = testEnv;
// _coreInstance = instances[2];
// _dataProviderInstance = instances[3];
// _poolInstance = instances[4];
// });
// it('tries to call the initialization function on LendingPoolConfigurator', async () => { const name = await (await getAToken(newATokenAddress)).name();
// await expectRevert(
// _configuratorInstance.initialize(_addressesProviderInstance.address),
// 'Contract instance has already been initialized'
// );
// });
// it('tries to call the initialization function on LendingPoolCore', async () => { await configurator.updateAToken(dai.address, newATokenAddress);
// await expectRevert(
// _coreInstance.initialize(_addressesProviderInstance.address),
// 'Contract instance has already been initialized'
// );
// });
// it('tries to call the initialization function on LendingPool', async () => { const tokenName = await aDai.name();
// await expectRevert(
// _poolInstance.initialize(_addressesProviderInstance.address),
// 'Contract instance has already been initialized'
// );
// });
// it('tries to call the initialization function on DataProvider', async () => { expect(tokenName).to.be.eq('Aave Interest bearing DAI updated', 'Invalid token name');
// await expectRevert( });
// _dataProviderInstance.initialize(_addressesProviderInstance.address), });
// 'Contract instance has already been initialized'
// );
// });
// it('Deploys a new version of a LendingPoolCore contract', async () => {
// const contract: any = await artifacts.require('MockLendingPoolCore');
// const mathLibrary = await artifacts.require('WadRayMath');
// const mathLibraryInstance = await mathLibrary.new();
// const coreLibrary = await artifacts.require('CoreLibrary');
// await coreLibrary.link('WadRayMath', mathLibraryInstance.address);
// await contract.link('CoreLibrary', coreLibrary.address);
// await contract.link('WadRayMath', mathLibraryInstance.address);
// _mockCoreInstance = await contract.new();
// const txResult = await _addressesProviderInstance.setLendingPoolCoreImpl(
// _mockCoreInstance.address
// );
// expectEvent(txResult, 'LendingPoolCoreUpdated', {
// newAddress: _mockCoreInstance.address,
// });
// });
// it('Tries to execute initialize() on the newly deployed core', async () => {
// const coreProxyAddress = await _addressesProviderInstance.getLendingPoolCore();
// const instance: LendingPoolCoreInstance = await getTruffleContractInstance(
// artifacts,
// ContractId.LendingPoolCore,
// coreProxyAddress
// );
// await expectRevert(
// instance.initialize(_addressesProviderInstance.address),
// 'Contract instance has already been initialized'
// );
// });
// it('Tries to deposit', async () => {
// const coreProxyAddress = await _addressesProviderInstance.getLendingPoolCore();
// const txReceipt: Truffle.TransactionResponse = await _poolInstance.deposit(
// ETHEREUM_ADDRESS,
// '100',
// '0',
// {value: '100'}
// );
// expectEvent.inTransaction(txReceipt.tx, coreProxyAddress, 'ReserveUpdatedFromMock', {
// revision: new BN(2),
// });
// });
// });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,12 @@
/* Generated by ts-generator ver. 0.0.8 */ /* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */ /* tslint:disable */
import { Contract, ContractFactory, Signer } from "ethers"; import {Contract, ContractFactory, Signer} from 'ethers';
import { Provider } from "ethers/providers"; import {Provider} from 'ethers/providers';
import { UnsignedTransaction } from "ethers/utils/transaction"; import {UnsignedTransaction} from 'ethers/utils/transaction';
import { TransactionOverrides } from "."; import {TransactionOverrides} from '.';
import { FeeProvider } from "./FeeProvider"; import {FeeProvider} from './FeeProvider';
export class FeeProviderFactory extends ContractFactory { export class FeeProviderFactory extends ContractFactory {
constructor(signer?: Signer) { constructor(signer?: Signer) {
@ -25,10 +25,7 @@ export class FeeProviderFactory extends ContractFactory {
connect(signer: Signer): FeeProviderFactory { connect(signer: Signer): FeeProviderFactory {
return super.connect(signer) as FeeProviderFactory; return super.connect(signer) as FeeProviderFactory;
} }
static connect( static connect(address: string, signerOrProvider: Signer | Provider): FeeProvider {
address: string,
signerOrProvider: Signer | Provider
): FeeProvider {
return new Contract(address, _abi, signerOrProvider) as FeeProvider; return new Contract(address, _abi, signerOrProvider) as FeeProvider;
} }
} }
@ -36,81 +33,81 @@ export class FeeProviderFactory extends ContractFactory {
const _abi = [ const _abi = [
{ {
inputs: [], inputs: [],
name: "FEE_PROVIDER_REVISION", name: 'FEE_PROVIDER_REVISION',
outputs: [ outputs: [
{ {
internalType: "uint256", internalType: 'uint256',
name: "", name: '',
type: "uint256" type: 'uint256',
} },
], ],
stateMutability: "view", stateMutability: 'view',
type: "function" type: 'function',
}, },
{ {
inputs: [ inputs: [
{ {
internalType: "address", internalType: 'address',
name: "_user", name: '_user',
type: "address" type: 'address',
}, },
{ {
internalType: "uint256", internalType: 'uint256',
name: "_amount", name: '_amount',
type: "uint256" type: 'uint256',
} },
], ],
name: "calculateLoanOriginationFee", name: 'calculateLoanOriginationFee',
outputs: [ outputs: [
{ {
internalType: "uint256", internalType: 'uint256',
name: "", name: '',
type: "uint256" type: 'uint256',
} },
], ],
stateMutability: "view", stateMutability: 'view',
type: "function" type: 'function',
}, },
{ {
inputs: [], inputs: [],
name: "getLoanOriginationFeePercentage", name: 'getLoanOriginationFeePercentage',
outputs: [ outputs: [
{ {
internalType: "uint256", internalType: 'uint256',
name: "", name: '',
type: "uint256" type: 'uint256',
} },
], ],
stateMutability: "view", stateMutability: 'view',
type: "function" type: 'function',
}, },
{ {
inputs: [ inputs: [
{ {
internalType: "address", internalType: 'address',
name: "_addressesProvider", name: '_addressesProvider',
type: "address" type: 'address',
} },
], ],
name: "initialize", name: 'initialize',
outputs: [], outputs: [],
stateMutability: "nonpayable", stateMutability: 'nonpayable',
type: "function" type: 'function',
}, },
{ {
inputs: [], inputs: [],
name: "originationFeePercentage", name: 'originationFeePercentage',
outputs: [ outputs: [
{ {
internalType: "uint256", internalType: 'uint256',
name: "", name: '',
type: "uint256" type: 'uint256',
} },
], ],
stateMutability: "view", stateMutability: 'view',
type: "function" type: 'function',
} },
]; ];
const _bytecode = const _bytecode =
"0x60806040526000805534801561001457600080fd5b50610411806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80639403ed3a1461005c578063b0d73d4e14610076578063c211f9a41461007e578063c4d66de814610086578063e563a7d0146100ae575b600080fd5b6100646100da565b60408051918252519081900360200190f35b6100646100e0565b6100646100e5565b6100ac6004803603602081101561009c57600080fd5b50356001600160a01b03166100eb565b005b610064600480360360408110156100c457600080fd5b506001600160a01b038135169060200135610193565b60345481565b600181565b60345490565b60006100f56101b3565b60015490915060ff168061010c575061010c6101b8565b80610118575060005481115b6101535760405162461bcd60e51b815260040180806020018281038252602e8152602001806103ae602e913960400191505060405180910390fd5b60015460ff16158015610172576001805460ff19168117905560008290555b6608e1bc9bf04000603455801561018e576001805460ff191690555b505050565b60006101aa603454836101be90919063ffffffff16565b90505b92915050565b600190565b303b1590565b60006101aa670de0b6b3a76400006101ee6101df868663ffffffff6101fa16565b6706f05b59d3b2000090610253565b9063ffffffff6102ad16565b600082610209575060006101ad565b8282028284828161021657fe5b04146101aa5760405162461bcd60e51b815260040180806020018281038252602181526020018061038d6021913960400191505060405180910390fd5b6000828201838110156101aa576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006101aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836103765760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561033b578181015183820152602001610323565b50505050905090810190601f1680156103685780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161038257fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a2646970667358221220b1f57d34e2488cabb196d838daf85a2a940face5fe23e3b0d48f388ca9f005b864736f6c63430006080033"; '0x60806040526000805534801561001457600080fd5b5061082d806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80639403ed3a1461005c578063b0d73d4e14610076578063c211f9a41461007e578063c4d66de814610086578063e563a7d0146100ae575b600080fd5b6100646100da565b60408051918252519081900360200190f35b6100646100e0565b6100646100e5565b6100ac6004803603602081101561009c57600080fd5b50356001600160a01b03166100eb565b005b610064600480360360408110156100c457600080fd5b506001600160a01b03813516906020013561021f565b60345481565b600181565b60345490565b61011e6040518060400160405280601281526020017124b739b4b2329034b734ba34b0b634bd32b960711b81525061023f565b6000610128610381565b905061015a6040518060400160405280600e81526020016d5265766973696f6e20697320257360901b81525082610386565b61018460405180604001604052806008815260200167546869733a20257360c01b815250306104db565b60015460ff168061019857506101986105d4565b806101a4575060005481115b6101df5760405162461bcd60e51b815260040180806020018281038252602e8152602001806107ca602e913960400191505060405180910390fd5b60015460ff161580156101fe576001805460ff19168117905560008290555b6608e1bc9bf04000603455801561021a576001805460ff191690555b505050565b6000610236603454836105da90919063ffffffff16565b90505b92915050565b6040516020602482018181528351604484015283516000936a636f6e736f6c652e6c6f67938693928392606401918501908083838a5b8381101561028d578181015183820152602001610275565b50505050905090810190601f1680156102ba5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b031663104c13eb60e21b178152905182519295509350839250908083835b602083106103155780518252601f1990920191602091820191016102f6565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114610375576040519150601f19603f3d011682016040523d82523d6000602084013e61037a565b606091505b5050505050565b600190565b60006a636f6e736f6c652e6c6f676001600160a01b031683836040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156103e55781810151838201526020016103cd565b50505050905090810190601f1680156104125780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b03166309710a9d60e41b17815290518251929650945084935091508083835b6020831061046e5780518252601f19909201916020918201910161044f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146104ce576040519150601f19603f3d011682016040523d82523d6000602084013e6104d3565b606091505b505050505050565b60006a636f6e736f6c652e6c6f676001600160a01b031683836040516024018080602001836001600160a01b03166001600160a01b03168152602001828103825284818151815260200191508051906020019080838360005b8381101561054c578181015183820152602001610534565b50505050905090810190601f1680156105795780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b031663319af33360e01b17815290518251929650945084935091508083836020831061046e5780518252601f19909201916020918201910161044f565b303b1590565b6000610236670de0b6b3a764000061060a6105fb868663ffffffff61061616565b6706f05b59d3b200009061066f565b9063ffffffff6106c916565b60008261062557506000610239565b8282028284828161063257fe5b04146102365760405162461bcd60e51b81526004018080602001828103825260218152602001806107a96021913960400191505060405180910390fd5b600082820183811015610236576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061023683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836107925760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561075757818101518382015260200161073f565b50505050905090810190601f1680156107845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161079e57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a264697066735822122096e37c04d1727fcae260159451045b2fd3d49634fccba582da71becd432f644f64736f6c63430006080033';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,14 @@
/* Generated by ts-generator ver. 0.0.8 */ /* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */ /* tslint:disable */
import { Contract, ContractTransaction, EventFilter, Signer } from "ethers"; import {Contract, ContractTransaction, EventFilter, Signer} from 'ethers';
import { Listener, Provider } from "ethers/providers"; import {Listener, Provider} from 'ethers/providers';
import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils"; import {Arrayish, BigNumber, BigNumberish, Interface} from 'ethers/utils';
import { import {TransactionOverrides, TypedEventDescription, TypedFunctionDescription} from '.';
TransactionOverrides,
TypedEventDescription,
TypedFunctionDescription
} from ".";
interface LendingPoolConfiguratorInterface extends Interface { interface LendingPoolConfiguratorInterface extends Interface {
functions: { functions: {
CONFIGURATOR_REVISION: TypedFunctionDescription<{ encode([]: []): string }>; CONFIGURATOR_REVISION: TypedFunctionDescription<{encode([]: []): string}>;
activateReserve: TypedFunctionDescription<{ activateReserve: TypedFunctionDescription<{
encode([_reserve]: [string]): string; encode([_reserve]: [string]): string;
@ -39,12 +35,12 @@ interface LendingPoolConfiguratorInterface extends Interface {
}>; }>;
enableReserveAsCollateral: TypedFunctionDescription<{ enableReserveAsCollateral: TypedFunctionDescription<{
encode([ encode([_reserve, _baseLTVasCollateral, _liquidationThreshold, _liquidationBonus]: [
_reserve, string,
_baseLTVasCollateral, BigNumberish,
_liquidationThreshold, BigNumberish,
_liquidationBonus BigNumberish
]: [string, BigNumberish, BigNumberish, BigNumberish]): string; ]): string;
}>; }>;
enableReserveStableRate: TypedFunctionDescription<{ enableReserveStableRate: TypedFunctionDescription<{
@ -62,7 +58,7 @@ interface LendingPoolConfiguratorInterface extends Interface {
_stableDebtTokenAddress, _stableDebtTokenAddress,
_variableDebtTokenAddress, _variableDebtTokenAddress,
_underlyingAssetDecimals, _underlyingAssetDecimals,
_interestRateStrategyAddress _interestRateStrategyAddress,
]: [string, string, string, string, BigNumberish, string]): string; ]: [string, string, string, string, BigNumberish, string]): string;
}>; }>;
@ -70,9 +66,9 @@ interface LendingPoolConfiguratorInterface extends Interface {
encode([_poolAddressesProvider]: [string]): string; encode([_poolAddressesProvider]: [string]): string;
}>; }>;
pool: TypedFunctionDescription<{ encode([]: []): string }>; pool: TypedFunctionDescription<{encode([]: []): string}>;
poolAddressesProvider: TypedFunctionDescription<{ encode([]: []): string }>; poolAddressesProvider: TypedFunctionDescription<{encode([]: []): string}>;
setLiquidationBonus: TypedFunctionDescription<{ setLiquidationBonus: TypedFunctionDescription<{
encode([_reserve, _bonus]: [string, BigNumberish]): string; encode([_reserve, _bonus]: [string, BigNumberish]): string;
@ -97,6 +93,10 @@ interface LendingPoolConfiguratorInterface extends Interface {
unfreezeReserve: TypedFunctionDescription<{ unfreezeReserve: TypedFunctionDescription<{
encode([_reserve]: [string]): string; encode([_reserve]: [string]): string;
}>; }>;
updateAToken: TypedFunctionDescription<{
encode([_reserve, _implementation]: [string, string]): string;
}>;
}; };
events: { events: {
@ -176,21 +176,13 @@ interface LendingPoolConfiguratorInterface extends Interface {
} }
export class LendingPoolConfigurator extends Contract { export class LendingPoolConfigurator extends Contract {
connect( connect(signerOrProvider: Signer | Provider | string): LendingPoolConfigurator;
signerOrProvider: Signer | Provider | string
): LendingPoolConfigurator;
attach(addressOrName: string): LendingPoolConfigurator; attach(addressOrName: string): LendingPoolConfigurator;
deployed(): Promise<LendingPoolConfigurator>; deployed(): Promise<LendingPoolConfigurator>;
on(event: EventFilter | string, listener: Listener): LendingPoolConfigurator; on(event: EventFilter | string, listener: Listener): LendingPoolConfigurator;
once( once(event: EventFilter | string, listener: Listener): LendingPoolConfigurator;
event: EventFilter | string, addListener(eventName: EventFilter | string, listener: Listener): LendingPoolConfigurator;
listener: Listener
): LendingPoolConfigurator;
addListener(
eventName: EventFilter | string,
listener: Listener
): LendingPoolConfigurator;
removeAllListeners(eventName: EventFilter | string): LendingPoolConfigurator; removeAllListeners(eventName: EventFilter | string): LendingPoolConfigurator;
removeListener(eventName: any, listener: Listener): LendingPoolConfigurator; removeListener(eventName: any, listener: Listener): LendingPoolConfigurator;
@ -243,10 +235,7 @@ export class LendingPoolConfigurator extends Contract {
overrides?: TransactionOverrides overrides?: TransactionOverrides
): Promise<ContractTransaction>; ): Promise<ContractTransaction>;
freezeReserve( freezeReserve(_reserve: string, overrides?: TransactionOverrides): Promise<ContractTransaction>;
_reserve: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
initReserve( initReserve(
_reserve: string, _reserve: string,
@ -301,14 +290,17 @@ export class LendingPoolConfigurator extends Contract {
_reserve: string, _reserve: string,
overrides?: TransactionOverrides overrides?: TransactionOverrides
): Promise<ContractTransaction>; ): Promise<ContractTransaction>;
updateAToken(
_reserve: string,
_implementation: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
}; };
CONFIGURATOR_REVISION(): Promise<BigNumber>; CONFIGURATOR_REVISION(): Promise<BigNumber>;
activateReserve( activateReserve(_reserve: string, overrides?: TransactionOverrides): Promise<ContractTransaction>;
_reserve: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
deactivateReserve( deactivateReserve(
_reserve: string, _reserve: string,
@ -349,10 +341,7 @@ export class LendingPoolConfigurator extends Contract {
overrides?: TransactionOverrides overrides?: TransactionOverrides
): Promise<ContractTransaction>; ): Promise<ContractTransaction>;
freezeReserve( freezeReserve(_reserve: string, overrides?: TransactionOverrides): Promise<ContractTransaction>;
_reserve: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
initReserve( initReserve(
_reserve: string, _reserve: string,
@ -403,18 +392,18 @@ export class LendingPoolConfigurator extends Contract {
overrides?: TransactionOverrides overrides?: TransactionOverrides
): Promise<ContractTransaction>; ): Promise<ContractTransaction>;
unfreezeReserve( unfreezeReserve(_reserve: string, overrides?: TransactionOverrides): Promise<ContractTransaction>;
updateAToken(
_reserve: string, _reserve: string,
_implementation: string,
overrides?: TransactionOverrides overrides?: TransactionOverrides
): Promise<ContractTransaction>; ): Promise<ContractTransaction>;
filters: { filters: {
BorrowingDisabledOnReserve(_reserve: string | null): EventFilter; BorrowingDisabledOnReserve(_reserve: string | null): EventFilter;
BorrowingEnabledOnReserve( BorrowingEnabledOnReserve(_reserve: null, _stableRateEnabled: null): EventFilter;
_reserve: null,
_stableRateEnabled: null
): EventFilter;
ReserveActivated(_reserve: string | null): EventFilter; ReserveActivated(_reserve: string | null): EventFilter;
@ -441,17 +430,11 @@ export class LendingPoolConfigurator extends Contract {
_interestRateStrategyAddress: null _interestRateStrategyAddress: null
): EventFilter; ): EventFilter;
ReserveInterestRateStrategyChanged( ReserveInterestRateStrategyChanged(_reserve: null, _strategy: null): EventFilter;
_reserve: null,
_strategy: null
): EventFilter;
ReserveLiquidationBonusChanged(_reserve: null, _bonus: null): EventFilter; ReserveLiquidationBonusChanged(_reserve: null, _bonus: null): EventFilter;
ReserveLiquidationThresholdChanged( ReserveLiquidationThresholdChanged(_reserve: null, _threshold: null): EventFilter;
_reserve: null,
_threshold: null
): EventFilter;
ReserveUnfreezed(_reserve: string | null): EventFilter; ReserveUnfreezed(_reserve: string | null): EventFilter;
@ -504,22 +487,13 @@ export class LendingPoolConfigurator extends Contract {
poolAddressesProvider(): Promise<BigNumber>; poolAddressesProvider(): Promise<BigNumber>;
setLiquidationBonus( setLiquidationBonus(_reserve: string, _bonus: BigNumberish): Promise<BigNumber>;
_reserve: string,
_bonus: BigNumberish
): Promise<BigNumber>;
setLiquidationThreshold( setLiquidationThreshold(_reserve: string, _threshold: BigNumberish): Promise<BigNumber>;
_reserve: string,
_threshold: BigNumberish
): Promise<BigNumber>;
setLtv(_reserve: string, _ltv: BigNumberish): Promise<BigNumber>; setLtv(_reserve: string, _ltv: BigNumberish): Promise<BigNumber>;
setReserveDecimals( setReserveDecimals(_reserve: string, _decimals: BigNumberish): Promise<BigNumber>;
_reserve: string,
_decimals: BigNumberish
): Promise<BigNumber>;
setReserveInterestRateStrategyAddress( setReserveInterestRateStrategyAddress(
_reserve: string, _reserve: string,
@ -527,5 +501,7 @@ export class LendingPoolConfigurator extends Contract {
): Promise<BigNumber>; ): Promise<BigNumber>;
unfreezeReserve(_reserve: string): Promise<BigNumber>; unfreezeReserve(_reserve: string): Promise<BigNumber>;
updateAToken(_reserve: string, _implementation: string): Promise<BigNumber>;
}; };
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

594
types/MockAToken.d.ts vendored Normal file
View File

@ -0,0 +1,594 @@
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */
import { Contract, ContractTransaction, EventFilter, Signer } from "ethers";
import { Listener, Provider } from "ethers/providers";
import { Arrayish, BigNumber, BigNumberish, Interface } from "ethers/utils";
import {
TransactionOverrides,
TypedEventDescription,
TypedFunctionDescription
} from ".";
interface MockATokenInterface extends Interface {
functions: {
ATOKEN_REVISION: TypedFunctionDescription<{ encode([]: []): string }>;
UINT_MAX_VALUE: TypedFunctionDescription<{ encode([]: []): string }>;
allowInterestRedirectionTo: TypedFunctionDescription<{
encode([_to]: [string]): string;
}>;
allowance: TypedFunctionDescription<{
encode([owner, spender]: [string, string]): string;
}>;
approve: TypedFunctionDescription<{
encode([spender, amount]: [string, BigNumberish]): string;
}>;
balanceOf: TypedFunctionDescription<{ encode([_user]: [string]): string }>;
burnOnLiquidation: TypedFunctionDescription<{
encode([_account, _value]: [string, BigNumberish]): string;
}>;
decimals: TypedFunctionDescription<{ encode([]: []): string }>;
decreaseAllowance: TypedFunctionDescription<{
encode([spender, subtractedValue]: [string, BigNumberish]): string;
}>;
getInterestRedirectionAddress: TypedFunctionDescription<{
encode([_user]: [string]): string;
}>;
getRedirectedBalance: TypedFunctionDescription<{
encode([_user]: [string]): string;
}>;
getUserIndex: TypedFunctionDescription<{
encode([_user]: [string]): string;
}>;
increaseAllowance: TypedFunctionDescription<{
encode([spender, addedValue]: [string, BigNumberish]): string;
}>;
initialize: TypedFunctionDescription<{
encode([_underlyingAssetDecimals, _tokenName, _tokenSymbol]: [
BigNumberish,
string,
string
]): string;
}>;
isTransferAllowed: TypedFunctionDescription<{
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
mintOnDeposit: TypedFunctionDescription<{
encode([_account, _amount]: [string, BigNumberish]): string;
}>;
name: TypedFunctionDescription<{ encode([]: []): string }>;
principalBalanceOf: TypedFunctionDescription<{
encode([_user]: [string]): string;
}>;
redeem: TypedFunctionDescription<{
encode([_amount]: [BigNumberish]): string;
}>;
redirectInterestStream: TypedFunctionDescription<{
encode([_to]: [string]): string;
}>;
redirectInterestStreamOf: TypedFunctionDescription<{
encode([_from, _to]: [string, string]): string;
}>;
symbol: TypedFunctionDescription<{ encode([]: []): string }>;
totalSupply: TypedFunctionDescription<{ encode([]: []): string }>;
transfer: TypedFunctionDescription<{
encode([recipient, amount]: [string, BigNumberish]): string;
}>;
transferFrom: TypedFunctionDescription<{
encode([sender, recipient, amount]: [
string,
string,
BigNumberish
]): string;
}>;
transferOnLiquidation: TypedFunctionDescription<{
encode([_from, _to, _value]: [string, string, BigNumberish]): string;
}>;
transferUnderlyingTo: TypedFunctionDescription<{
encode([_target, _amount]: [string, BigNumberish]): string;
}>;
underlyingAssetAddress: TypedFunctionDescription<{
encode([]: []): string;
}>;
};
events: {
Approval: TypedEventDescription<{
encodeTopics([owner, spender, value]: [
string | null,
string | null,
null
]): string[];
}>;
BalanceTransfer: TypedEventDescription<{
encodeTopics([
_from,
_to,
_value,
_fromBalanceIncrease,
_toBalanceIncrease,
_fromIndex,
_toIndex
]: [
string | null,
string | null,
null,
null,
null,
null,
null
]): string[];
}>;
BurnOnLiquidation: TypedEventDescription<{
encodeTopics([_from, _value, _fromBalanceIncrease, _fromIndex]: [
string | null,
null,
null,
null
]): string[];
}>;
InterestRedirectionAllowanceChanged: TypedEventDescription<{
encodeTopics([_from, _to]: [string | null, string | null]): string[];
}>;
InterestStreamRedirected: TypedEventDescription<{
encodeTopics([
_from,
_to,
_redirectedBalance,
_fromBalanceIncrease,
_fromIndex
]: [string | null, string | null, null, null, null]): string[];
}>;
MintOnDeposit: TypedEventDescription<{
encodeTopics([_from, _value, _fromBalanceIncrease, _fromIndex]: [
string | null,
null,
null,
null
]): string[];
}>;
Redeem: TypedEventDescription<{
encodeTopics([_from, _value, _fromBalanceIncrease, _fromIndex]: [
string | null,
null,
null,
null
]): string[];
}>;
RedirectedBalanceUpdated: TypedEventDescription<{
encodeTopics([
_targetAddress,
_targetBalanceIncrease,
_targetIndex,
_redirectedBalanceAdded,
_redirectedBalanceRemoved
]: [string | null, null, null, null, null]): string[];
}>;
Transfer: TypedEventDescription<{
encodeTopics([from, to, value]: [
string | null,
string | null,
null
]): string[];
}>;
};
}
export class MockAToken extends Contract {
connect(signerOrProvider: Signer | Provider | string): MockAToken;
attach(addressOrName: string): MockAToken;
deployed(): Promise<MockAToken>;
on(event: EventFilter | string, listener: Listener): MockAToken;
once(event: EventFilter | string, listener: Listener): MockAToken;
addListener(eventName: EventFilter | string, listener: Listener): MockAToken;
removeAllListeners(eventName: EventFilter | string): MockAToken;
removeListener(eventName: any, listener: Listener): MockAToken;
interface: MockATokenInterface;
functions: {
ATOKEN_REVISION(): Promise<BigNumber>;
UINT_MAX_VALUE(): Promise<BigNumber>;
allowInterestRedirectionTo(
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(
spender: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(_user: string): Promise<BigNumber>;
burnOnLiquidation(
_account: string,
_value: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
decimals(): Promise<number>;
decreaseAllowance(
spender: string,
subtractedValue: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
getInterestRedirectionAddress(_user: string): Promise<string>;
getRedirectedBalance(_user: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
increaseAllowance(
spender: string,
addedValue: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
initialize(
_underlyingAssetDecimals: BigNumberish,
_tokenName: string,
_tokenSymbol: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
isTransferAllowed(_user: string, _amount: BigNumberish): Promise<boolean>;
mintOnDeposit(
_account: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(_user: string): Promise<BigNumber>;
redeem(
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
redirectInterestStream(
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
redirectInterestStreamOf(
_from: string,
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
symbol(): Promise<string>;
totalSupply(): Promise<BigNumber>;
transfer(
recipient: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferOnLiquidation(
_from: string,
_to: string,
_value: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferUnderlyingTo(
_target: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
underlyingAssetAddress(): Promise<string>;
};
ATOKEN_REVISION(): Promise<BigNumber>;
UINT_MAX_VALUE(): Promise<BigNumber>;
allowInterestRedirectionTo(
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(
spender: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(_user: string): Promise<BigNumber>;
burnOnLiquidation(
_account: string,
_value: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
decimals(): Promise<number>;
decreaseAllowance(
spender: string,
subtractedValue: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
getInterestRedirectionAddress(_user: string): Promise<string>;
getRedirectedBalance(_user: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
increaseAllowance(
spender: string,
addedValue: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
initialize(
_underlyingAssetDecimals: BigNumberish,
_tokenName: string,
_tokenSymbol: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
isTransferAllowed(_user: string, _amount: BigNumberish): Promise<boolean>;
mintOnDeposit(
_account: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(_user: string): Promise<BigNumber>;
redeem(
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
redirectInterestStream(
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
redirectInterestStreamOf(
_from: string,
_to: string,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
symbol(): Promise<string>;
totalSupply(): Promise<BigNumber>;
transfer(
recipient: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferOnLiquidation(
_from: string,
_to: string,
_value: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferUnderlyingTo(
_target: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
underlyingAssetAddress(): Promise<string>;
filters: {
Approval(
owner: string | null,
spender: string | null,
value: null
): EventFilter;
BalanceTransfer(
_from: string | null,
_to: string | null,
_value: null,
_fromBalanceIncrease: null,
_toBalanceIncrease: null,
_fromIndex: null,
_toIndex: null
): EventFilter;
BurnOnLiquidation(
_from: string | null,
_value: null,
_fromBalanceIncrease: null,
_fromIndex: null
): EventFilter;
InterestRedirectionAllowanceChanged(
_from: string | null,
_to: string | null
): EventFilter;
InterestStreamRedirected(
_from: string | null,
_to: string | null,
_redirectedBalance: null,
_fromBalanceIncrease: null,
_fromIndex: null
): EventFilter;
MintOnDeposit(
_from: string | null,
_value: null,
_fromBalanceIncrease: null,
_fromIndex: null
): EventFilter;
Redeem(
_from: string | null,
_value: null,
_fromBalanceIncrease: null,
_fromIndex: null
): EventFilter;
RedirectedBalanceUpdated(
_targetAddress: string | null,
_targetBalanceIncrease: null,
_targetIndex: null,
_redirectedBalanceAdded: null,
_redirectedBalanceRemoved: null
): EventFilter;
Transfer(from: string | null, to: string | null, value: null): EventFilter;
};
estimate: {
ATOKEN_REVISION(): Promise<BigNumber>;
UINT_MAX_VALUE(): Promise<BigNumber>;
allowInterestRedirectionTo(_to: string): Promise<BigNumber>;
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(spender: string, amount: BigNumberish): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
burnOnLiquidation(
_account: string,
_value: BigNumberish
): Promise<BigNumber>;
decimals(): Promise<BigNumber>;
decreaseAllowance(
spender: string,
subtractedValue: BigNumberish
): Promise<BigNumber>;
getInterestRedirectionAddress(_user: string): Promise<BigNumber>;
getRedirectedBalance(_user: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
increaseAllowance(
spender: string,
addedValue: BigNumberish
): Promise<BigNumber>;
initialize(
_underlyingAssetDecimals: BigNumberish,
_tokenName: string,
_tokenSymbol: string
): Promise<BigNumber>;
isTransferAllowed(_user: string, _amount: BigNumberish): Promise<BigNumber>;
mintOnDeposit(_account: string, _amount: BigNumberish): Promise<BigNumber>;
name(): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
redeem(_amount: BigNumberish): Promise<BigNumber>;
redirectInterestStream(_to: string): Promise<BigNumber>;
redirectInterestStreamOf(_from: string, _to: string): Promise<BigNumber>;
symbol(): Promise<BigNumber>;
totalSupply(): Promise<BigNumber>;
transfer(recipient: string, amount: BigNumberish): Promise<BigNumber>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish
): Promise<BigNumber>;
transferOnLiquidation(
_from: string,
_to: string,
_value: BigNumberish
): Promise<BigNumber>;
transferUnderlyingTo(
_target: string,
_amount: BigNumberish
): Promise<BigNumber>;
underlyingAssetAddress(): Promise<BigNumber>;
};
}

901
types/MockATokenFactory.ts Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -121,4 +121,4 @@ const _abi = [
]; ];
const _bytecode = const _bytecode =
"0x608060405234801561001057600080fd5b506040516105fd3803806105fd8339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610598806100656000396000f3fe6080604052600436106100295760003560e01c806329589f611461002e5780634f1b86eb146100ec575b600080fd5b6100da600480360361010081101561004557600080fd5b6001600160a01b0382358116926020810135926040820135831692606083013581169260808101359260a08201359260c0830135169190810190610100810160e082013564010000000081111561009b57600080fd5b8201836020820111156100ad57600080fd5b803590602001918460018302840111640100000000831117156100cf57600080fd5b50909250905061011d565b60408051918252519081900360200190f35b3480156100f857600080fd5b50610101610266565b604080516001600160a01b039092168252519081900360200190f35b600080546040805163140e25ad60e31b8152670de0b6b3a7640000600482015290516001600160a01b039092169163a0712d689160248082019260209290919082900301818787803b15801561017257600080fd5b505af1158015610186573d6000803e3d6000fd5b505050506040513d602081101561019c57600080fd5b50516101ef576040805162461bcd60e51b815260206004820181905260248201527f54524144455f574954485f48494e542e205265766572746564206d696e742829604482015290519081900360640190fd5b6101f7610275565b6001600160a01b03168a6001600160a01b03161461022a5761022a6001600160a01b038b1633308c63ffffffff61028d16565b60005461024f906001600160a01b031633670de0b6b3a764000063ffffffff6102ed16565b50670de0b6b3a76400009998505050505050505050565b6000546001600160a01b031681565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526102e7908590610344565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261033f908490610344565b505050565b610356826001600160a01b03166104fc565b6103a7576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106103e55780518252601f1990920191602091820191016103c6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610447576040519150601f19603f3d011682016040523d82523d6000602084013e61044c565b606091505b5091509150816104a3576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156102e7578080602001905160208110156104bf57600080fd5b50516102e75760405162461bcd60e51b815260040180806020018281038252602a815260200180610539602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061053057508115155b94935050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212204217cd7d546f66051c30fdaa4e283314470f9c5edda974b8ca382dab7b05781364736f6c63430006080033"; "0x608060405234801561001057600080fd5b506040516106b53803806106b58339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610650806100656000396000f3fe6080604052600436106100295760003560e01c806329589f611461002e5780634f1b86eb146100ec575b600080fd5b6100da600480360361010081101561004557600080fd5b6001600160a01b0382358116926020810135926040820135831692606083013581169260808101359260a08201359260c0830135169190810190610100810160e082013564010000000081111561009b57600080fd5b8201836020820111156100ad57600080fd5b803590602001918460018302840111640100000000831117156100cf57600080fd5b50909250905061011d565b60408051918252519081900360200190f35b3480156100f857600080fd5b50610101610266565b604080516001600160a01b039092168252519081900360200190f35b600080546040805163140e25ad60e31b8152670de0b6b3a7640000600482015290516001600160a01b039092169163a0712d689160248082019260209290919082900301818787803b15801561017257600080fd5b505af1158015610186573d6000803e3d6000fd5b505050506040513d602081101561019c57600080fd5b50516101ef576040805162461bcd60e51b815260206004820181905260248201527f54524144455f574954485f48494e542e205265766572746564206d696e742829604482015290519081900360640190fd5b6101f7610275565b6001600160a01b03168a6001600160a01b03161461022a5761022a6001600160a01b038b1633308c63ffffffff61028d16565b60005461024f906001600160a01b031633670de0b6b3a764000063ffffffff6102ed16565b50670de0b6b3a76400009998505050505050505050565b6000546001600160a01b031681565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526102e7908590610344565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261033f908490610344565b505050565b6060610399826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f59092919063ffffffff16565b80519091501561033f578080602001905160208110156103b857600080fd5b505161033f5760405162461bcd60e51b815260040180806020018281038252602a8152602001806105f1602a913960400191505060405180910390fd5b6060610404848460008561040c565b949350505050565b6060610417856105b7565b610468576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106104a75780518252601f199092019160209182019101610488565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610509576040519150601f19603f3d011682016040523d82523d6000602084013e61050e565b606091505b509150915081156105225791506104049050565b8051156105325780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561057c578181015183820152602001610564565b50505050905090810190601f1680156105a95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061040457505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122099f447de7dc340bb9fad6029140c928c6fde2d7c3b3f7bb83714a93e38cb1f2f64736f6c63430006080033";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -134,4 +134,4 @@ const _abi = [
]; ];
const _bytecode = const _bytecode =
"0x608060405234801561001057600080fd5b506040516109863803806109868339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610921806100656000396000f3fe6080604052600436106100385760003560e01c80639e3c930914610083578063b59b28ef1461014f578063f7888aec146102d35761007e565b3661007e5761004633610320565b61007c576040805162461bcd60e51b8152602060048201526002602482015261191960f11b604482015290519081900360640190fd5b005b600080fd5b34801561008f57600080fd5b506100b6600480360360208110156100a657600080fd5b50356001600160a01b031661035c565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100fa5781810151838201526020016100e2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610139578181015183820152602001610121565b5050505090500194505050505060405180910390f35b34801561015b57600080fd5b506102836004803603604081101561017257600080fd5b81019060208101813564010000000081111561018d57600080fd5b82018360208201111561019f57600080fd5b803590602001918460208302840111640100000000831117156101c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561021157600080fd5b82018360208201111561022357600080fd5b8035906020019184602083028401116401000000008311171561024557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106a0945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102bf5781810151838201526020016102a7565b505050509050019250505060405180910390f35b3480156102df57600080fd5b5061030e600480360360408110156102f657600080fd5b506001600160a01b038135811691602001351661081c565b60408051918252519081900360200190f35b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061035457508115155b949350505050565b60608060008060009054906101000a90046001600160a01b03166001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505160408051630240bc6b60e21b815290519192506060916001600160a01b03841691630902f1ac916004808301926000929190829003018186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561045d57600080fd5b810190808051604051939291908464010000000082111561047d57600080fd5b90830190602082018581111561049257600080fd5b82518660208202830111640100000000821117156104af57600080fd5b82525081516020918201928201910280838360005b838110156104dc5781810151838201526020016104c4565b5050505090500160405250505090506060815167ffffffffffffffff8111801561050557600080fd5b5060405190808252806020026020018201604052801561052f578160200160208202803683370190505b50905060005b8251811015610694576000846001600160a01b0316633e15014185848151811061055b57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b031681526020019150506101406040518083038186803b1580156105aa57600080fd5b505afa1580156105be573d6000803e3d6000fd5b505050506040513d6101408110156105d557600080fd5b5061010001519050806106025760008383815181106105f057fe5b6020026020010181815250505061068c565b61062784838151811061061157fe5b60200260200101516001600160a01b03166108c6565b15610666576106498885848151811061063c57fe5b602002602001015161081c565b83838151811061065557fe5b60200260200101818152505061068a565b876001600160a01b03163183838151811061067d57fe5b6020026020010181815250505b505b600101610535565b50909350915050915091565b606080825184510267ffffffffffffffff811180156106be57600080fd5b506040519080825280602002602001820160405280156106e8578160200160208202803683370190505b50905060005b84518110156108125760005b845181101561080957600085518302905061071a86838151811061061157fe5b1561075c5786838151811061072b57fe5b60200260200101516001600160a01b031631848383018151811061074b57fe5b602002602001018181525050610800565b61078186838151811061076b57fe5b60200260200101516001600160a01b0316610320565b6107c2576040805162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015290519081900360640190fd5b6107e58784815181106107d157fe5b602002602001015187848151811061063c57fe5b84838301815181106107f357fe5b6020026020010181815250505b506001016106fa565b506001016106ee565b5090505b92915050565b6000610830826001600160a01b0316610320565b156108be57816001600160a01b03166370a08231846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561088b57600080fd5b505afa15801561089f573d6000803e3d6000fd5b505050506040513d60208110156108b557600080fd5b50519050610816565b506000610816565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1491905056fea26469706673582212209b8e0b168415dbdcd196e0ea333c3828a2128ab32bf0abfd98b6628e2bbe360c64736f6c63430006080033"; "0x608060405234801561001057600080fd5b506040516109863803806109868339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610921806100656000396000f3fe6080604052600436106100385760003560e01c80639e3c930914610083578063b59b28ef1461014f578063f7888aec146102d35761007e565b3661007e5761004633610320565b61007c576040805162461bcd60e51b8152602060048201526002602482015261191960f11b604482015290519081900360640190fd5b005b600080fd5b34801561008f57600080fd5b506100b6600480360360208110156100a657600080fd5b50356001600160a01b031661035c565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100fa5781810151838201526020016100e2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610139578181015183820152602001610121565b5050505090500194505050505060405180910390f35b34801561015b57600080fd5b506102836004803603604081101561017257600080fd5b81019060208101813564010000000081111561018d57600080fd5b82018360208201111561019f57600080fd5b803590602001918460208302840111640100000000831117156101c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561021157600080fd5b82018360208201111561022357600080fd5b8035906020019184602083028401116401000000008311171561024557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106a0945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102bf5781810151838201526020016102a7565b505050509050019250505060405180910390f35b3480156102df57600080fd5b5061030e600480360360408110156102f657600080fd5b506001600160a01b038135811691602001351661081c565b60408051918252519081900360200190f35b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061035457508115155b949350505050565b60608060008060009054906101000a90046001600160a01b03166001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505160408051630240bc6b60e21b815290519192506060916001600160a01b03841691630902f1ac916004808301926000929190829003018186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561045d57600080fd5b810190808051604051939291908464010000000082111561047d57600080fd5b90830190602082018581111561049257600080fd5b82518660208202830111640100000000821117156104af57600080fd5b82525081516020918201928201910280838360005b838110156104dc5781810151838201526020016104c4565b5050505090500160405250505090506060815167ffffffffffffffff8111801561050557600080fd5b5060405190808252806020026020018201604052801561052f578160200160208202803683370190505b50905060005b8251811015610694576000846001600160a01b0316633e15014185848151811061055b57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b031681526020019150506101406040518083038186803b1580156105aa57600080fd5b505afa1580156105be573d6000803e3d6000fd5b505050506040513d6101408110156105d557600080fd5b5061010001519050806106025760008383815181106105f057fe5b6020026020010181815250505061068c565b61062784838151811061061157fe5b60200260200101516001600160a01b03166108c6565b15610666576106498885848151811061063c57fe5b602002602001015161081c565b83838151811061065557fe5b60200260200101818152505061068a565b876001600160a01b03163183838151811061067d57fe5b6020026020010181815250505b505b600101610535565b50909350915050915091565b606080825184510267ffffffffffffffff811180156106be57600080fd5b506040519080825280602002602001820160405280156106e8578160200160208202803683370190505b50905060005b84518110156108125760005b845181101561080957600085518302905061071a86838151811061061157fe5b1561075c5786838151811061072b57fe5b60200260200101516001600160a01b031631848383018151811061074b57fe5b602002602001018181525050610800565b61078186838151811061076b57fe5b60200260200101516001600160a01b0316610320565b6107c2576040805162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015290519081900360640190fd5b6107e58784815181106107d157fe5b602002602001015187848151811061063c57fe5b84838301815181106107f357fe5b6020026020010181815250505b506001016106fa565b506001016106ee565b5090505b92915050565b6000610830826001600160a01b0316610320565b156108be57816001600160a01b03166370a08231846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561088b57600080fd5b505afa15801561089f573d6000803e3d6000fd5b505050506040513d60208110156108b557600080fd5b50519050610816565b506000610816565b6001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1491905056fea2646970667358221220ba894c2eba77f05be9d541a00a65fbec4e5924a19f513c8f596076cb70bd139c64736f6c63430006080033";