@settlemint/solidity-token-erc20-crowdsale
Version:
Smart contract set to build an ERC20 token sale in SettleMint
391 lines (385 loc) • 21.1 kB
TypeScript
// This file was autogenerated by hardhat-viem, do not edit it.
// prettier-ignore
// tslint:disable
// eslint-disable
import type { Address } from "viem";
import type { AbiParameterToPrimitiveType, GetContractReturnType } from "@nomicfoundation/hardhat-viem/types";
import "@nomicfoundation/hardhat-viem/types";
export interface ExampleVestingWallet$Type {
"_format": "hh-sol-artifact-1",
"contractName": "ExampleVestingWallet",
"sourceName": "contracts/ExampleVestingWallet.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "beneficiaryAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "startTimestamp",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "durationSeconds",
"type": "uint64"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "FailedCall",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "needed",
"type": "uint256"
}
],
"name": "InsufficientBalance",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "SafeERC20FailedOperation",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "ERC20Released",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "EtherReleased",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "duration",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "end",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "releasable",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "releasable",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "release",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "release",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "released",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "released",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "start",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "timestamp",
"type": "uint64"
}
],
"name": "vestedAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint64",
"name": "timestamp",
"type": "uint64"
}
],
"name": "vestedAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"bytecode": "0x60c03461011057601f610b9838819003918201601f19168301916001600160401b03831184841017610115578084926060946040528339810103126101105780516001600160a01b03811691908290036101105761006b60406100646020840161012b565b920161012b565b9082156100fa57600080546001600160a01b031981168517825560405194916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360805260a052610a5890816101408239608051818181610217015281816108dc0152610911015260a0518181816106a8015281816108b101526109790152f35b631e4fbdf760e01b600052600060045260246000fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160401b03821682036101105756fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80630a17b06b146106cc5780630fb5a6b414610687578063191655871461054a578063715018a6146104cc578063810ec23b1461049257806386d1a69f146102f75780638da5cb5b146102c357806396132521146102a55780639852595c1461025e578063a3f8eace1461023b578063be9a6555146101f6578063efbe1c1c146101db578063f2fde38b146101075763fbccedae0361000e57346101025760006003193601126101025760206100fa6100f1476100ec67ffffffffffffffff42169160015490610727565b610901565b60015490610853565b604051908152f35b600080fd5b346101025760206003193601126101025773ffffffffffffffffffffffffffffffffffffffff610135610704565b61013d6109d3565b1680156101ac5773ffffffffffffffffffffffffffffffffffffffff600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f1e4fbdf700000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b346101025760006003193601126101025760206100fa6108a3565b3461010257600060031936011261010257602060405167ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101025760206003193601126101025760206100fa610259610704565b610860565b346101025760206003193601126101025773ffffffffffffffffffffffffffffffffffffffff61028c610704565b1660005260026020526020604060002054604051908152f35b34610102576000600319360112610102576020600154604051908152f35b3461010257600060031936011261010257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b3461010257600060031936011261010257610324476100ec67ffffffffffffffff42169160015490610727565b61033b6103346001548093610853565b8092610727565b6001557fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b6020604051838152a173ffffffffffffffffffffffffffffffffffffffff6000541681471061046057600080809381935af13d15610458573d9067ffffffffffffffff821161042957604051916103de60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610763565b82523d6000602084013e5b156103f057005b8051156103ff57805190602001fd5b7fd6bda2750000000000000000000000000000000000000000000000000000000060005260046000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060906103e9565b50477fcf4791810000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b34610102576040600319360112610102576104ab610704565b6024359067ffffffffffffffff82168203610102576020916100fa916107a4565b34610102576000600319360112610102576104e56109d3565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461010257602060031936011261010257610563610704565b6020600073ffffffffffffffffffffffffffffffffffffffff61058584610860565b931692838252600283526040822061059e828254610727565b9055837fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b84604051848152a273ffffffffffffffffffffffffffffffffffffffff8254169060405190848201927fa9059cbb0000000000000000000000000000000000000000000000000000000084526024830152604482015260448152610627606482610763565b519082855af11561067b576000513d6106725750803b155b61064557005b7f5274afe70000000000000000000000000000000000000000000000000000000060005260045260246000fd5b6001141561063f565b6040513d6000823e3d90fd5b3461010257600060031936011261010257602060405167ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101025760206003193601126101025760043567ffffffffffffffff81168103610102576100fa6020916100ec4760015490610727565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361010257565b9190820180921161073457565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761042957604052565b73ffffffffffffffffffffffffffffffffffffffff16906040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152602081602481865afa90811561067b5760009161081f575b506100ec9061081c93600052600260205260406000205490610727565b90565b90506020813d60201161084b575b8161083a60209383610763565b81010312610102575161081c6107ff565b3d915061082d565b9190820391821161073457565b61081c9073ffffffffffffffffffffffffffffffffffffffff61088d67ffffffffffffffff4216836107a4565b9116600052600260205260406000205490610853565b61081c67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001667ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016610727565b9067ffffffffffffffff908116907f0000000000000000000000000000000000000000000000000000000000000000168082101561094157505050600090565b6109496108a3565b821061095457505090565b61095d91610853565b908181029181830414901517156107345767ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169081156109a4570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff6000541633036109f457565b7f118cdaa7000000000000000000000000000000000000000000000000000000006000523360045260246000fdfea264697066735822122031328d55e2422f5525e0d234fa2fbf6b808aa8d0c0569dc37b7d59856c7c6f1e64736f6c634300081b0033",
"deployedBytecode": "0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c80630a17b06b146106cc5780630fb5a6b414610687578063191655871461054a578063715018a6146104cc578063810ec23b1461049257806386d1a69f146102f75780638da5cb5b146102c357806396132521146102a55780639852595c1461025e578063a3f8eace1461023b578063be9a6555146101f6578063efbe1c1c146101db578063f2fde38b146101075763fbccedae0361000e57346101025760006003193601126101025760206100fa6100f1476100ec67ffffffffffffffff42169160015490610727565b610901565b60015490610853565b604051908152f35b600080fd5b346101025760206003193601126101025773ffffffffffffffffffffffffffffffffffffffff610135610704565b61013d6109d3565b1680156101ac5773ffffffffffffffffffffffffffffffffffffffff600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f1e4fbdf700000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b346101025760006003193601126101025760206100fa6108a3565b3461010257600060031936011261010257602060405167ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101025760206003193601126101025760206100fa610259610704565b610860565b346101025760206003193601126101025773ffffffffffffffffffffffffffffffffffffffff61028c610704565b1660005260026020526020604060002054604051908152f35b34610102576000600319360112610102576020600154604051908152f35b3461010257600060031936011261010257602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b3461010257600060031936011261010257610324476100ec67ffffffffffffffff42169160015490610727565b61033b6103346001548093610853565b8092610727565b6001557fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b6020604051838152a173ffffffffffffffffffffffffffffffffffffffff6000541681471061046057600080809381935af13d15610458573d9067ffffffffffffffff821161042957604051916103de60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610763565b82523d6000602084013e5b156103f057005b8051156103ff57805190602001fd5b7fd6bda2750000000000000000000000000000000000000000000000000000000060005260046000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060906103e9565b50477fcf4791810000000000000000000000000000000000000000000000000000000060005260045260245260446000fd5b34610102576040600319360112610102576104ab610704565b6024359067ffffffffffffffff82168203610102576020916100fa916107a4565b34610102576000600319360112610102576104e56109d3565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461010257602060031936011261010257610563610704565b6020600073ffffffffffffffffffffffffffffffffffffffff61058584610860565b931692838252600283526040822061059e828254610727565b9055837fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b84604051848152a273ffffffffffffffffffffffffffffffffffffffff8254169060405190848201927fa9059cbb0000000000000000000000000000000000000000000000000000000084526024830152604482015260448152610627606482610763565b519082855af11561067b576000513d6106725750803b155b61064557005b7f5274afe70000000000000000000000000000000000000000000000000000000060005260045260246000fd5b6001141561063f565b6040513d6000823e3d90fd5b3461010257600060031936011261010257602060405167ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101025760206003193601126101025760043567ffffffffffffffff81168103610102576100fa6020916100ec4760015490610727565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361010257565b9190820180921161073457565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761042957604052565b73ffffffffffffffffffffffffffffffffffffffff16906040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152602081602481865afa90811561067b5760009161081f575b506100ec9061081c93600052600260205260406000205490610727565b90565b90506020813d60201161084b575b8161083a60209383610763565b81010312610102575161081c6107ff565b3d915061082d565b9190820391821161073457565b61081c9073ffffffffffffffffffffffffffffffffffffffff61088d67ffffffffffffffff4216836107a4565b9116600052600260205260406000205490610853565b61081c67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001667ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016610727565b9067ffffffffffffffff908116907f0000000000000000000000000000000000000000000000000000000000000000168082101561094157505050600090565b6109496108a3565b821061095457505090565b61095d91610853565b908181029181830414901517156107345767ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169081156109a4570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff6000541633036109f457565b7f118cdaa7000000000000000000000000000000000000000000000000000000006000523360045260246000fdfea264697066735822122031328d55e2422f5525e0d234fa2fbf6b808aa8d0c0569dc37b7d59856c7c6f1e64736f6c634300081b0033",
"linkReferences": {},
"deployedLinkReferences": {}
}
declare module "@nomicfoundation/hardhat-viem/types" {
export function deployContract(
contractName: "ExampleVestingWallet",
constructorArgs: [beneficiaryAddress: AbiParameterToPrimitiveType<{"name":"beneficiaryAddress","type":"address"}>, startTimestamp: AbiParameterToPrimitiveType<{"name":"startTimestamp","type":"uint64"}>, durationSeconds: AbiParameterToPrimitiveType<{"name":"durationSeconds","type":"uint64"}>],
config?: DeployContractConfig
): Promise<GetContractReturnType<ExampleVestingWallet$Type["abi"]>>;
export function deployContract(
contractName: "contracts/ExampleVestingWallet.sol:ExampleVestingWallet",
constructorArgs: [beneficiaryAddress: AbiParameterToPrimitiveType<{"name":"beneficiaryAddress","type":"address"}>, startTimestamp: AbiParameterToPrimitiveType<{"name":"startTimestamp","type":"uint64"}>, durationSeconds: AbiParameterToPrimitiveType<{"name":"durationSeconds","type":"uint64"}>],
config?: DeployContractConfig
): Promise<GetContractReturnType<ExampleVestingWallet$Type["abi"]>>;
export function sendDeploymentTransaction(
contractName: "ExampleVestingWallet",
constructorArgs: [beneficiaryAddress: AbiParameterToPrimitiveType<{"name":"beneficiaryAddress","type":"address"}>, startTimestamp: AbiParameterToPrimitiveType<{"name":"startTimestamp","type":"uint64"}>, durationSeconds: AbiParameterToPrimitiveType<{"name":"durationSeconds","type":"uint64"}>],
config?: SendDeploymentTransactionConfig
): Promise<{
contract: GetContractReturnType<ExampleVestingWallet$Type["abi"]>;
deploymentTransaction: GetTransactionReturnType;
}>;
export function sendDeploymentTransaction(
contractName: "contracts/ExampleVestingWallet.sol:ExampleVestingWallet",
constructorArgs: [beneficiaryAddress: AbiParameterToPrimitiveType<{"name":"beneficiaryAddress","type":"address"}>, startTimestamp: AbiParameterToPrimitiveType<{"name":"startTimestamp","type":"uint64"}>, durationSeconds: AbiParameterToPrimitiveType<{"name":"durationSeconds","type":"uint64"}>],
config?: SendDeploymentTransactionConfig
): Promise<{
contract: GetContractReturnType<ExampleVestingWallet$Type["abi"]>;
deploymentTransaction: GetTransactionReturnType;
}>;
export function getContractAt(
contractName: "ExampleVestingWallet",
address: Address,
config?: GetContractAtConfig
): Promise<GetContractReturnType<ExampleVestingWallet$Type["abi"]>>;
export function getContractAt(
contractName: "contracts/ExampleVestingWallet.sol:ExampleVestingWallet",
address: Address,
config?: GetContractAtConfig
): Promise<GetContractReturnType<ExampleVestingWallet$Type["abi"]>>;
}