mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
529 lines
19 KiB
TypeScript
529 lines
19 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 { StableDebtToken } from "./StableDebtToken";
|
|
|
|
export class StableDebtTokenFactory extends ContractFactory {
|
|
constructor(signer?: Signer) {
|
|
super(_abi, _bytecode, signer);
|
|
}
|
|
|
|
deploy(overrides?: TransactionOverrides): Promise<StableDebtToken> {
|
|
return super.deploy(overrides) as Promise<StableDebtToken>;
|
|
}
|
|
getDeployTransaction(overrides?: TransactionOverrides): UnsignedTransaction {
|
|
return super.getDeployTransaction(overrides);
|
|
}
|
|
attach(address: string): StableDebtToken {
|
|
return super.attach(address) as StableDebtToken;
|
|
}
|
|
connect(signer: Signer): StableDebtTokenFactory {
|
|
return super.connect(signer) as StableDebtTokenFactory;
|
|
}
|
|
static connect(
|
|
address: string,
|
|
signerOrProvider: Signer | Provider
|
|
): StableDebtToken {
|
|
return new Contract(address, _abi, signerOrProvider) as StableDebtToken;
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
],
|
|
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: "_newRate",
|
|
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: "account",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "balanceOf",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_account",
|
|
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: [],
|
|
name: "getAverageStableRate",
|
|
outputs: [
|
|
{
|
|
internalType: "uint256",
|
|
name: "",
|
|
type: "uint256"
|
|
}
|
|
],
|
|
stateMutability: "view",
|
|
type: "function"
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: "address",
|
|
name: "_user",
|
|
type: "address"
|
|
}
|
|
],
|
|
name: "getUserStableRate",
|
|
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: "account",
|
|
type: "address"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "amount",
|
|
type: "uint256"
|
|
},
|
|
{
|
|
internalType: "uint256",
|
|
name: "rate",
|
|
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: "account",
|
|
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 =
|
|
"0x608060405234801561001057600080fd5b50611209806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806389d1a0fc116100a2578063a457c2d711610071578063a457c2d71461027a578063a9059cbb14610473578063c634dfaa1461049f578063dd62ed3e146104c5578063e78c9b3b146104f357610116565b806389d1a0fc1461041357806390f6fcf21461043757806395d89b411461043f5780639dc29fac1461044757610116565b806323b872dd116100e957806323b872dd14610226578063313ce5671461025c578063395093511461027a57806370a08231146102a657806381e75277146102cc57610116565b806306fdde031461011b578063095ea7b314610198578063156e29f6146101d857806318160ddd1461020c575b600080fd5b610123610519565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356105a6565b604080519115158252519081900360200190f35b61020a600480360360608110156101ee57600080fd5b506001600160a01b0381351690602081013590604001356105ee565b005b6102146107da565b60408051918252519081900360200190f35b6101c46004803603606081101561023c57600080fd5b506001600160a01b038135811691602081013590911690604001356107e0565b610264610828565b6040805160ff9092168252519081900360200190f35b6101c46004803603604081101561029057600080fd5b506001600160a01b038135169060200135610831565b610214600480360360208110156102bc57600080fd5b50356001600160a01b0316610880565b61020a600480360360a08110156102e257600080fd5b8101906020810181356401000000008111156102fd57600080fd5b82018360208201111561030f57600080fd5b8035906020019184600183028401116401000000008311171561033157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561038457600080fd5b82018360208201111561039657600080fd5b803590602001918460018302840111640100000000831117156103b857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505060ff8335169350506001600160a01b0360208301358116926040013516905061092a565b61041b610a0f565b604080516001600160a01b039092168252519081900360200190f35b610214610a23565b610123610a2a565b61020a6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610a82565b6101c46004803603604081101561048957600080fd5b506001600160a01b0381351690602001356107e0565b610214600480360360208110156104b557600080fd5b50356001600160a01b0316610bd5565b610214600480360360408110156104db57600080fd5b506001600160a01b0381358116916020013516610831565b6102146004803603602081101561050957600080fd5b50356001600160a01b0316610bf0565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561059e5780601f106105735761010080835404028352916020019161059e565b820191906000526020600020905b81548152906001019060200180831161058157829003601f168201915b505050505081565b6040805162461bcd60e51b81526020600482015260166024820152751054141493d5905317d393d517d4d5541413d495115160521b6044820152905160009181900360640190fd5b6004546001600160a01b031633146106375760405162461bcd60e51b81526004018080602001828103825260328152602001806111a26032913960400191505060405180910390fd5b600080600061064586610c0b565b925092509250600061066286600054610c6190919063ffffffff16565b9050600061066f87610cc4565b90506106e861068c610687868a63ffffffff610c6116565b610cc4565b6106dc61069f848a63ffffffff610cda16565b6106d06106ab89610cc4565b6001600160a01b038e166000908152600760205260409020549063ffffffff610d2016565b9063ffffffff610c6116565b9063ffffffff610d5916565b6001600160a01b0389166000908152600760205260409020908155600101805464ffffffffff19164264ffffffffff1617905561075761072783610cc4565b6106dc61073a898563ffffffff610d2016565b6106d0610748600054610cc4565b6006549063ffffffff610d2016565b6006556107648888610d91565b6001600160a01b0388166000818152600760209081526040918290205482519384529083018a9052828201889052606083018790526080830186905260a0830152517f94ba3ac5ed6fee7b49ed817c5ee964eed9bd5da6860344f95fc56997e920381d9181900360c00190a15050505050505050565b60005481565b6040805162461bcd60e51b81526020600482015260166024820152751514905394d1915497d393d517d4d5541413d495115160521b6044820152905160009181900360640190fd5b60035460ff1681565b6040805162461bcd60e51b815260206004820152601760248201527f414c4c4f57414e43455f4e4f545f535550504f525445440000000000000000006044820152905160009181900360640190fd5b6001600160a01b0381166000908152600560205260408120546108a557506000610925565b6001600160a01b0382166000908152600760205260408120805460018201549192916108d8919064ffffffffff16610def565b905061092061091b8261090f60056000896001600160a01b03166001600160a01b0316815260200190815260200160002054610cc4565b9063ffffffff610d2016565b610e47565b925050505b919050565b845161093d9060019060208801906110e8565b5083516109519060029060208701906110e8565b506003805460ff191660ff851617610100600160a81b0319166101006001600160a01b03858116919091029190911790915560408051630261bf8b60e01b8152905191831691630261bf8b91600480820192602092909190829003018186803b1580156109bd57600080fd5b505afa1580156109d1573d6000803e3d6000fd5b505050506040513d60208110156109e757600080fd5b5051600480546001600160a01b0319166001600160a01b039092169190911790555050505050565b60035461010090046001600160a01b031681565b6006545b90565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561059e5780601f106105735761010080835404028352916020019161059e565b6004546001600160a01b03163314610acb5760405162461bcd60e51b81526004018080602001828103825260328152602001806111a26032913960400191505060405180910390fd5b6000806000610ad985610c0b565b9250925092506000610af685600054610e6790919063ffffffff16565b90506000610b0386610cc4565b905081610b14576000600655610b6b565b610b67610b2083610cc4565b6001600160a01b0389166000908152600760205260409020546106dc90610b4d908563ffffffff610d2016565b610b5b610748600054610cc4565b9063ffffffff610e6716565b6006555b610b758787610ea9565b604080516001600160a01b038916815260208101889052808201879052606081018690526080810185905290517fecde08620c30706a4d7ba53e9163327f2e12a6cea2709dd6a9226fed28c2bb729181900360a00190a150505050505050565b6001600160a01b031660009081526005602052604090205490565b6001600160a01b031660009081526007602052604090205490565b6001600160a01b0381166000908152600560205260408120548190819081610c3682610b5b88610880565b9050610c428682610d91565b81610c53818363ffffffff610c6116565b909790965090945092505050565b600082820183811015610cbb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000610cbe82633b9aca0063ffffffff610ee716565b6000610cbb670de0b6b3a7640000610d14610cfb868663ffffffff610ee716565b6002670de0b6b3a76400005b049063ffffffff610c6116565b9063ffffffff610f4016565b6000610cbb6b033b2e3c9fd0803ce8000000610d14610d45868663ffffffff610ee716565b60026b033b2e3c9fd0803ce8000000610d07565b600060028204610d8983610d14610d7c876b033b2e3c9fd0803ce8000000610ee7565b849063ffffffff610c6116565b949350505050565b600054610da4908263ffffffff610c6116565b60009081556001600160a01b038316815260056020526040902054610dcf908263ffffffff610c6116565b6001600160a01b0390921660009081526005602052604090209190915550565b600080610e094264ffffffffff851663ffffffff610e6716565b90506000610e21856301e1338063ffffffff610f4016565b9050610e3e82610e32610d7c610f82565b9063ffffffff610f9216565b95945050505050565b6000631dcd6500610e60633b9aca00610d148386610c61565b9392505050565b6000610cbb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fec565b600054610ebc908263ffffffff610e6716565b60009081556001600160a01b038316815260056020526040902054610dcf908263ffffffff610e6716565b600082610ef657506000610cbe565b82820282848281610f0357fe5b0414610cbb5760405162461bcd60e51b81526004018080602001828103825260218152602001806111816021913960400191505060405180910390fd5b6000610cbb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611083565b6b033b2e3c9fd0803ce800000090565b600060028206610fae576b033b2e3c9fd0803ce8000000610fb0565b825b90506002820491505b8115610cbe57610fc98384610d20565b92506002820615610fe157610fde8184610d20565b90505b600282049150610fb9565b6000818484111561107b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611040578181015183820152602001611028565b50505050905090810190601f16801561106d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836110d25760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611040578181015183820152602001611028565b5060008385816110de57fe5b0495945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061112957805160ff1916838001178555611156565b82800160010185558215611156579182015b8281111561115657825182559160200191906001019061113b565b50611162929150611166565b5090565b610a2791905b80821115611162576000815560010161116c56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652063616c6c6572206f6620746869732066756e6374696f6e206d7573742062652061206c656e64696e6720706f6f6ca26469706673582212201d4dcbdeb278fec9d6b1301234044646914fb3c644717cfd7b552a0fc5bae53f64736f6c63430006080033";
|