@descent-protocol/sdk
Version:
A Typescript library for interacting with the Descent Protocol
720 lines (712 loc) • 24.5 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
Contract,
ContractFactory,
ContractTransactionResponse,
Interface,
} from "ethers";
import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers";
import type { NonPayableOverrides } from "../common";
import type { Currency, CurrencyInterface } from "../Currency";
const _abi = [
{
inputs: [
{
internalType: "string",
name: "name_",
type: "string",
},
{
internalType: "string",
name: "symbol_",
type: "string",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
inputs: [],
name: "AllowanceOverflow",
type: "error",
},
{
inputs: [],
name: "AllowanceUnderflow",
type: "error",
},
{
inputs: [],
name: "AlreadyInitialized",
type: "error",
},
{
inputs: [],
name: "InsufficientAllowance",
type: "error",
},
{
inputs: [],
name: "InsufficientBalance",
type: "error",
},
{
inputs: [],
name: "InvalidPermit",
type: "error",
},
{
inputs: [],
name: "NewOwnerIsZeroAddress",
type: "error",
},
{
inputs: [],
name: "NoHandoverRequest",
type: "error",
},
{
inputs: [],
name: "NotMinter",
type: "error",
},
{
inputs: [],
name: "PermitExpired",
type: "error",
},
{
inputs: [],
name: "TotalSupplyOverflow",
type: "error",
},
{
inputs: [],
name: "Unauthorized",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "owner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "spender",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "Approval",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "OwnershipHandoverCanceled",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "OwnershipHandoverRequested",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "oldOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "bool",
name: "enabled",
type: "bool",
},
],
name: "Permit2AllowanceUpdated",
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: "amount",
type: "uint256",
},
],
name: "Transfer",
type: "event",
},
{
inputs: [],
name: "DOMAIN_SEPARATOR",
outputs: [
{
internalType: "bytes32",
name: "result",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "PERMIT2",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
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: "owner",
type: "address",
},
],
name: "balanceOf",
outputs: [
{
internalType: "uint256",
name: "result",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "burn",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "cancelOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "completeOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "decimals",
outputs: [
{
internalType: "uint8",
name: "",
type: "uint8",
},
],
stateMutability: "pure",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "mint",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "minterRole",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "name",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
],
name: "nonces",
outputs: [
{
internalType: "uint256",
name: "result",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "result",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "pendingOwner",
type: "address",
},
],
name: "ownershipHandoverExpiresAt",
outputs: [
{
internalType: "uint256",
name: "result",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
{
internalType: "address",
name: "spender",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "uint256",
name: "deadline",
type: "uint256",
},
{
internalType: "uint8",
name: "v",
type: "uint8",
},
{
internalType: "bytes32",
name: "r",
type: "bytes32",
},
{
internalType: "bytes32",
name: "s",
type: "bytes32",
},
],
name: "permit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "permit2Enabled",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ERC20Token",
name: "token",
type: "address",
},
{
internalType: "address",
name: "to",
type: "address",
},
],
name: "recoverToken",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "requestOwnershipHandover",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
{
internalType: "bool",
name: "isMinter",
type: "bool",
},
],
name: "setMinterRole",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "symbol",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "totalSupply",
outputs: [
{
internalType: "uint256",
name: "result",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "to",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "transfer",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "from",
type: "address",
},
{
internalType: "address",
name: "to",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "transferFrom",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "enabled",
type: "bool",
},
],
name: "updatePermit2Allowance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
const _bytecode =
"0x60806040523480156200001157600080fd5b506040516200160938038062001609833981016040819052620000349162000173565b6200003f3362000072565b60006200004d83826200026c565b5060016200005c82826200026c565b50506002805460ff191660011790555062000338565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000d657600080fd5b81516001600160401b0380821115620000f357620000f3620000ae565b604051601f8301601f19908116603f011681019082821181831017156200011e576200011e620000ae565b816040528381526020925086838588010111156200013b57600080fd5b600091505b838210156200015f578582018301518183018401529082019062000140565b600093810190920192909252949350505050565b600080604083850312156200018757600080fd5b82516001600160401b03808211156200019f57600080fd5b620001ad86838701620000c4565b93506020850151915080821115620001c457600080fd5b50620001d385828601620000c4565b9150509250929050565b600181811c90821680620001f257607f821691505b6020821081036200021357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200026757600081815260208120601f850160051c81016020861015620002425750805b601f850160051c820191505b8181101562000263578281556001016200024e565b5050505b505050565b81516001600160401b03811115620002885762000288620000ae565b620002a081620002998454620001dd565b8462000219565b602080601f831160018114620002d85760008415620002bf5750858301515b600019600386901b1c1916600185901b17855562000263565b600085815260208120601f198616915b828110156200030957888601518255948401946001909101908401620002e8565b5085821015620003285787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6112c180620003486000396000f3fe6080604052600436106101ac5760003560e01c8063715018a6116100ec578063cb177b1e1161008a578063f04e283e11610064578063f04e283e146104bf578063f2fde38b146104d2578063feaea586146104e5578063fee81cf41461050557600080fd5b8063cb177b1e1461045f578063d505accf1461047f578063dd62ed3e1461049f57600080fd5b806395d89b41116100c657806395d89b41146103da5780639dc29fac146103ef578063a9059cbb1461040f578063ad0e7d8c1461042f57600080fd5b8063715018a61461036b5780637ecebe00146103735780638da5cb5b146103a657600080fd5b80633644e5151161015957806354d1f13d1161013357806354d1f13d146102c85780636afdd850146102d0578063705e6a5b1461031857806370a082311461033857600080fd5b80633644e51514610279578063407c48b41461028e57806340c10f19146102a857600080fd5b806323b872dd1161018a57806323b872dd146102335780632569296214610253578063313ce5671461025d57600080fd5b806306fdde03146101b1578063095ea7b3146101dc57806318160ddd1461020c575b600080fd5b3480156101bd57600080fd5b506101c6610538565b6040516101d39190611028565b60405180910390f35b3480156101e857600080fd5b506101fc6101f73660046110b6565b6105ca565b60405190151581526020016101d3565b34801561021857600080fd5b506805345cdf77eb68f44c545b6040519081526020016101d3565b34801561023f57600080fd5b506101fc61024e3660046110e2565b61061e565b61025b6106dc565b005b34801561026957600080fd5b50604051601281526020016101d3565b34801561028557600080fd5b5061022561072c565b34801561029a57600080fd5b506002546101fc9060ff1681565b3480156102b457600080fd5b506101fc6102c33660046110b6565b6107a9565b61025b610805565b3480156102dc57600080fd5b506102f36e22d473030f116ddee9f6b43ac78ba381565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d3565b34801561032457600080fd5b5061025b610333366004611138565b610841565b34801561034457600080fd5b50610225610353366004611153565b6387a211a2600c908152600091909152602090205490565b61025b6108af565b34801561037f57600080fd5b5061022561038e366004611153565b6338377508600c908152600091909152602090205490565b3480156103b257600080fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927546102f3565b3480156103e657600080fd5b506101c66108c3565b3480156103fb57600080fd5b506101fc61040a3660046110b6565b6108d2565b34801561041b57600080fd5b506101fc61042a3660046110b6565b610906565b34801561043b57600080fd5b506101fc61044a366004611153565b60036020526000908152604090205460ff1681565b34801561046b57600080fd5b5061025b61047a366004611170565b61097d565b34801561048b57600080fd5b5061025b61049a3660046111a5565b6109db565b3480156104ab57600080fd5b506102256104ba36600461121c565b610b75565b61025b6104cd366004611153565b610bfa565b61025b6104e0366004611153565b610c3a565b3480156104f157600080fd5b5061025b61050036600461121c565b610c61565b34801561051157600080fd5b50610225610520366004611153565b63389a75e1600c908152600091909152602090205490565b60606000805461054790611255565b80601f016020809104026020016040519081016040528092919081815260200182805461057390611255565b80156105c05780601f10610595576101008083540402835291602001916105c0565b820191906000526020600020905b8154815290600101906020018083116105a357829003601f168201915b5050505050905090565b600082602052637f5e9f20600c5233600052816034600c205581600052602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560206000a35060015b92915050565b60008360601b33602052637f5e9f208117600c526034600c208054600181011561065e5780851115610658576313be252b6000526004601cfd5b84810382555b50506387a211a28117600c526020600c208054808511156106875763f4d678b86000526004601cfd5b84810382555050836000526020600c208381540181555082602052600c5160601c8160601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505060019392505050565b60006202a30067ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b600080610737610538565b8051906020012090506040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b3360009081526003602052604081205460ff166107f2576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107fc8383610df7565b50600192915050565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b610849610e76565b60405181151581527f383d8f27281deff0ab982f76ad2feac76f0cb5d922008a4642d8765c748591329060200160405180910390a1600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6108b7610e76565b6108c16000610eac565b565b60606001805461054790611255565b600073ffffffffffffffffffffffffffffffffffffffff831633146108fc576108fc833384610f12565b6107fc8383610f55565b60006387a211a2600c52336000526020600c208054808411156109315763f4d678b86000526004601cfd5b83810382555050826000526020600c208281540181555081602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a36107fc565b610985610e76565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60006109e5610538565b80519060200120905084421115610a0457631a15a3cc6000526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52886000526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c206000528660ff1660205285604052846060526020806080600060015afa8b3d5114610b105763ddafbaef6000526004601cfd5b019055777f5e9f20000000000000000000000000000000000000000088176040526034602c2087905587897f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608501a360405250506000606052505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82166e22d473030f116ddee9f6b43ac78ba3148015610bad575060025460ff165b15610bd957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610618565b6020829052637f5e9f20600c908152600084905260349020545b9392505050565b610c02610e76565b63389a75e1600c52806000526020600c208054421115610c2a57636f5e88186000526004601cfd5b60009055610c3781610eac565b50565b610c42610e76565b8060601b610c5857637448fbae6000526004601cfd5b610c3781610eac565b610c69610e76565b73ffffffffffffffffffffffffffffffffffffffff821615610d24576040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610d20908390839073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610cf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1b91906112a8565b610fd9565b5050565b60008173ffffffffffffffffffffffffffffffffffffffff164760405160006040518083038185875af1925050503d8060008114610d7e576040519150601f19603f3d011682016040523d82523d6000602084013e610d83565b606091505b5050905080610df2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f7769746864726177206661696c65640000000000000000000000000000000000604482015260640160405180910390fd5b505050565b6805345cdf77eb68f44c5481810181811015610e1b5763e5cfe9576000526004601cfd5b806805345cdf77eb68f44c5550506387a211a2600c52816000526020600c208181540181555080602052600c5160601c60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146108c1576382b429006000526004601cfd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b81602052637f5e9f20600c52826000526034600c2080546001810115610f4e5780831115610f48576313be252b6000526004601cfd5b82810382555b5050505050565b6387a211a2600c52816000526020600c20805480831115610f7e5763f4d678b86000526004601cfd5b82900390556805345cdf77eb68f44c80548290039055600081815273ffffffffffffffffffffffffffffffffffffffff83167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602083a35050565b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d15600160005114171661101e576390b8ec186000526004601cfd5b6000603452505050565b600060208083528351808285015260005b8181101561105557858101830151858201604001528201611039565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c3757600080fd5b600080604083850312156110c957600080fd5b82356110d481611094565b946020939093013593505050565b6000806000606084860312156110f757600080fd5b833561110281611094565b9250602084013561111281611094565b929592945050506040919091013590565b8035801515811461113357600080fd5b919050565b60006020828403121561114a57600080fd5b610bf382611123565b60006020828403121561116557600080fd5b8135610bf381611094565b6000806040838503121561118357600080fd5b823561118e81611094565b915061119c60208401611123565b90509250929050565b600080600080600080600060e0888a0312156111c057600080fd5b87356111cb81611094565b965060208801356111db81611094565b95506040880135945060608801359350608088013560ff811681146111ff57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561122f57600080fd5b823561123a81611094565b9150602083013561124a81611094565b809150509250929050565b600181811c9082168061126957607f821691505b6020821081036112a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000602082840312156112ba57600080fd5b505191905056";
type CurrencyConstructorParams =
| [signer?: Signer]
| ConstructorParameters<typeof ContractFactory>;
const isSuperArgs = (
xs: CurrencyConstructorParams
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
export class Currency__factory extends ContractFactory {
constructor(...args: CurrencyConstructorParams) {
if (isSuperArgs(args)) {
super(...args);
} else {
super(_abi, _bytecode, args[0]);
}
}
override getDeployTransaction(
name_: string,
symbol_: string,
overrides?: NonPayableOverrides & { from?: string }
): Promise<ContractDeployTransaction> {
return super.getDeployTransaction(name_, symbol_, overrides || {});
}
override deploy(
name_: string,
symbol_: string,
overrides?: NonPayableOverrides & { from?: string }
) {
return super.deploy(name_, symbol_, overrides || {}) as Promise<
Currency & {
deploymentTransaction(): ContractTransactionResponse;
}
>;
}
override connect(runner: ContractRunner | null): Currency__factory {
return super.connect(runner) as Currency__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): CurrencyInterface {
return new Interface(_abi) as CurrencyInterface;
}
static connect(address: string, runner?: ContractRunner | null): Currency {
return new Contract(address, _abi, runner) as unknown as Currency;
}
}