mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
517 lines
18 KiB
TypeScript
517 lines
18 KiB
TypeScript
/* Generated by ts-generator ver. 0.0.8 */
|
|
/* tslint:disable */
|
|
|
|
import { Contract, ContractFactory, Signer } from "ethers";
|
|
import { Provider } from "ethers/providers";
|
|
import { UnsignedTransaction } from "ethers/utils/transaction";
|
|
|
|
import { TransactionOverrides } from ".";
|
|
import { VariableDebtToken } from "./VariableDebtToken";
|
|
|
|
export class VariableDebtTokenFactory extends ContractFactory {
|
|
constructor(signer?: Signer) {
|
|
super(_abi, _bytecode, signer);
|
|
}
|
|
|
|
deploy(overrides?: TransactionOverrides): Promise<VariableDebtToken> {
|
|
return super.deploy(overrides) as Promise<VariableDebtToken>;
|
|
}
|
|
getDeployTransaction(overrides?: TransactionOverrides): UnsignedTransaction {
|
|
return super.getDeployTransaction(overrides);
|
|
}
|
|
attach(address: string): VariableDebtToken {
|
|
return super.attach(address) as VariableDebtToken;
|
|
}
|
|
connect(signer: Signer): VariableDebtTokenFactory {
|
|
return super.connect(signer) as VariableDebtTokenFactory;
|
|
}
|
|
static connect(
|
|
address: string,
|
|
signerOrProvider: Signer | Provider
|
|
): VariableDebtToken {
|
|
return new Contract(address, _abi, signerOrProvider) as VariableDebtToken;
|
|
}
|
|
}
|
|
|
|
const _abi = [
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
internalType: "address",
|
|
name: "owner",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: "address",
|
|
name: "spender",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "value",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "Approval",
|
|
type: "event"
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
internalType: "address",
|
|
name: "from",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: "address",
|
|
name: "to",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "value",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "Transfer",
|
|
type: "event"
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: false,
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_previousBalance",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_currentBalance",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_balanceIncrease",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_index",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "burnDebt",
|
|
type: "event"
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: false,
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_previousBalance",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_currentBalance",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_balanceIncrease",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: "uint256",
|
|
name: "_index",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "mintDebt",
|
|
type: "event"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "owner",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "address",
|
|
name: "spender",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "allowance",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "spender",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "approve",
|
|
outputs: [
|
|
{
|
|
internalType: "bool",
|
|
name: "",
|
|
type: "bool"
|
|
}
|
|
],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "balanceOf",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "burn",
|
|
outputs: [],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: "decimals",
|
|
outputs: [
|
|
{
|
|
internalType: "uint8",
|
|
name: "",
|
|
type: "uint8"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "spender",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "subtractedValue",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "decreaseAllowance",
|
|
outputs: [
|
|
{
|
|
internalType: "bool",
|
|
name: "",
|
|
type: "bool"
|
|
}
|
|
],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "getUserIndex",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "spender",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "addedValue",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "increaseAllowance",
|
|
outputs: [
|
|
{
|
|
internalType: "bool",
|
|
name: "",
|
|
type: "bool"
|
|
}
|
|
],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "string",
|
|
name: "_name",
|
|
type: "string"
|
|
},
|
|
{
|
|
internalType: "string",
|
|
name: "_symbol",
|
|
type: "string"
|
|
},
|
|
{
|
|
internalType: "uint8",
|
|
name: "_decimals",
|
|
type: "uint8"
|
|
},
|
|
{
|
|
internalType: "address",
|
|
name: "_underlying",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "contract ILendingPoolAddressesProvider",
|
|
name: "_addressesProvider",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "init",
|
|
outputs: [],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "mint",
|
|
outputs: [],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: "name",
|
|
outputs: [
|
|
{
|
|
internalType: "string",
|
|
name: "",
|
|
type: "string"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "principalBalanceOf",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: "symbol",
|
|
outputs: [
|
|
{
|
|
internalType: "string",
|
|
name: "",
|
|
type: "string"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: "totalSupply",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "recipient",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "transfer",
|
|
outputs: [
|
|
{
|
|
internalType: "bool",
|
|
name: "",
|
|
type: "bool"
|
|
}
|
|
],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "sender",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "address",
|
|
name: "recipient",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "_amount",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
name: "transferFrom",
|
|
outputs: [
|
|
{
|
|
internalType: "bool",
|
|
name: "",
|
|
type: "bool"
|
|
}
|
|
],
|
|
stateMutability: "nonpayable",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: "underlyingAssetAddress",
|
|
outputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "",
|
|
type: "address"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
}
|
|
];
|
|
|
|
const _bytecode =
|
|
"0x608060405234801561001057600080fd5b5061110e806100206000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c806381e75277116100a2578063a457c2d711610071578063a457c2d71461023b578063a9059cbb1461045a578063c634dfaa14610486578063dd62ed3e146104ac578063ee9907a4146104da5761010b565b806381e75277146102bb57806389d1a0fc1461040257806395d89b41146104265780639dc29fac1461042e5761010b565b8063313ce567116100de578063313ce5671461021d578063395093511461023b57806340c10f191461026757806370a08231146102955761010b565b806306fdde0314610110578063095ea7b31461018d57806318160ddd146101cd57806323b872dd146101e7575b600080fd5b610118610500565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b9600480360360408110156101a357600080fd5b506001600160a01b03813516906020013561058d565b604080519115158252519081900360200190f35b6101d56105d5565b60408051918252519081900360200190f35b6101b9600480360360608110156101fd57600080fd5b506001600160a01b038135811691602081013590911690604001356105db565b610225610623565b6040805160ff9092168252519081900360200190f35b6101b96004803603604081101561025157600080fd5b506001600160a01b03813516906020013561062c565b6102936004803603604081101561027d57600080fd5b506001600160a01b03813516906020013561067b565b005b6101d5600480360360208110156102ab57600080fd5b50356001600160a01b03166107e2565b610293600480360360a08110156102d157600080fd5b8101906020810181356401000000008111156102ec57600080fd5b8201836020820111156102fe57600080fd5b8035906020019184600183028401116401000000008311171561032057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561037357600080fd5b82018360208201111561038557600080fd5b803590602001918460018302840111640100000000831117156103a757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505060ff8335169350506001600160a01b036020830135811692604001351690506108ef565b61040a6109d4565b604080516001600160a01b039092168252519081900360200190f35b6101186109e8565b6102936004803603604081101561044457600080fd5b506001600160a01b038135169060200135610a40565b6101b96004803603604081101561047057600080fd5b506001600160a01b0381351690602001356105db565b6101d56004803603602081101561049c57600080fd5b50356001600160a01b0316610be2565b6101d5600480360360408110156104c257600080fd5b506001600160a01b038135811691602001351661062c565b6101d5600480360360208110156104f057600080fd5b50356001600160a01b0316610bfd565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105855780601f1061055a57610100808354040283529160200191610585565b820191906000526020600020905b81548152906001019060200180831161056857829003601f168201915b505050505081565b6040805162461bcd60e51b81526020600482015260166024820152751054141493d5905317d393d517d4d5541413d495115160521b6044820152905160009181900360640190fd5b60005481565b6040805162461bcd60e51b81526020600482015260166024820152751514905394d1915497d393d517d4d5541413d495115160521b6044820152905160009181900360640190fd5b60035460ff1681565b6040805162461bcd60e51b815260206004820152601760248201527f414c4c4f57414e43455f4e4f545f535550504f525445440000000000000000006044820152905160009181900360640190fd5b6004546001600160a01b031633146106cb576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa1a0a62622a960911b604482015290519081900360640190fd5b60008060006106d985610c18565b9250925092506106e98585610c92565b600480546003546040805163386497fd60e01b81526001600160a01b036101009093048316948101949094525191169163386497fd916024808301926020929190829003018186803b15801561073e57600080fd5b505afa158015610752573d6000803e3d6000fd5b505050506040513d602081101561076857600080fd5b50516001600160a01b03861660008181526006602090815260409182902084905581519283528201879052818101869052606082018590526080820184905260a082019290925290517f94ba3ac5ed6fee7b49ed817c5ee964eed9bd5da6860344f95fc56997e920381d9181900360c00190a15050505050565b6001600160a01b038116600090815260056020526040812054610807575060006108ea565b6001600160a01b038083166000908152600660209081526040918290205460048054600354855163386497fd60e01b815261010090910487169281019290925293516108e7956108e29593946108d6949091169263386497fd9260248083019392829003018186803b15801561087c57600080fd5b505afa158015610890573d6000803e3d6000fd5b505050506040513d60208110156108a657600080fd5b50516001600160a01b0387166000908152600560205260409020546108ca90610cf0565b9063ffffffff610d0616565b9063ffffffff610d5316565b610d8b565b90505b919050565b845161090290600190602088019061101c565b50835161091690600290602087019061101c565b506003805460ff191660ff851617610100600160a81b0319166101006001600160a01b03858116919091029190911790915560408051630261bf8b60e01b8152905191831691630261bf8b91600480820192602092909190829003018186803b15801561098257600080fd5b505afa158015610996573d6000803e3d6000fd5b505050506040513d60208110156109ac57600080fd5b5051600480546001600160a01b0319166001600160a01b039092169190911790555050505050565b60035461010090046001600160a01b031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105855780601f1061055a57610100808354040283529160200191610585565b6004546001600160a01b03163314610a90576040805162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa1a0a62622a960911b604482015290519081900360640190fd5b6000806000610a9e85610c18565b925092509250610aae8585610dab565b83821415610ad4576001600160a01b038516600090815260066020526040812055610b6f565b600480546003546040805163386497fd60e01b81526001600160a01b036101009093048316948101949094525191169163386497fd916024808301926020929190829003018186803b158015610b2957600080fd5b505afa158015610b3d573d6000803e3d6000fd5b505050506040513d6020811015610b5357600080fd5b50516001600160a01b0386166000908152600660205260409020555b6001600160a01b038516600081815260066020908152604091829020548251938452908301879052828201869052606083018590526080830184905260a0830152517fc57f977ee00c44453a91f798753002bf12fca5f5ca2ee8db560720f51d4b0f629181900360c00190a15050505050565b6001600160a01b031660009081526005602052604090205490565b6001600160a01b031660009081526006602052604090205490565b6001600160a01b0381166000908152600560205260408120548190819080610c4a575060009250829150819050610c8b565b6000610c6582610c59886107e2565b9063ffffffff610de916565b9050610c718682610c92565b81610c82818363ffffffff610e2b16565b90955093509150505b9193909250565b600054610ca5908263ffffffff610e2b16565b60009081556001600160a01b038316815260056020526040902054610cd0908263ffffffff610e2b16565b6001600160a01b0390921660009081526005602052604090209190915550565b60006108e782633b9aca0063ffffffff610e8516565b6000610d4a6b033b2e3c9fd0803ce8000000610d3e610d2b868663ffffffff610e8516565b6b019d971e4fe8401e7400000090610e2b565b9063ffffffff610ede16565b90505b92915050565b600060028204610d8383610d3e610d76876b033b2e3c9fd0803ce8000000610e85565b849063ffffffff610e2b16565b949350505050565b6000631dcd6500610da4633b9aca00610d3e8386610e2b565b9392505050565b600054610dbe908263ffffffff610de916565b60009081556001600160a01b038316815260056020526040902054610cd0908263ffffffff610de916565b6000610d4a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f20565b600082820183811015610d4a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610e9457506000610d4d565b82820282848281610ea157fe5b0414610d4a5760405162461bcd60e51b81526004018080602001828103825260218152602001806110b86021913960400191505060405180910390fd5b6000610d4a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610fb7565b60008184841115610faf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f74578181015183820152602001610f5c565b50505050905090810190601f168015610fa15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836110065760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f74578181015183820152602001610f5c565b50600083858161101257fe5b0495945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061105d57805160ff191683800117855561108a565b8280016001018555821561108a579182015b8281111561108a57825182559160200191906001019061106f565b5061109692915061109a565b5090565b6110b491905b8082111561109657600081556001016110a0565b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220bc7027301c5bcd2931761f651bb0cb8f88db33072dd15890508aca0d43cd4d1c64736f6c63430006080033";
|