@b3dotfun/anyspend-sdk
Version:
React Hooks and UI Components for AnySpend by B3
300 lines (298 loc) • 9.63 kB
text/typescript
// https://basescan.org/address/0xbf04200be3cbf371467a539706393c81c470f523
export const ABI_ERC20_STAKING = [
{
inputs: [
{ internalType: "address", name: "_stakingToken", type: "address" },
{ internalType: "address", name: "_permittedStaker", type: "address" },
{ internalType: "uint256", name: "_unstakingStartBlock", type: "uint256" },
{ internalType: "uint256", name: "_cooldownPeriod", type: "uint256" },
{ internalType: "uint256", name: "_minStakingAmount", type: "uint256" }
],
stateMutability: "nonpayable",
type: "constructor"
},
{
inputs: [
{ internalType: "uint256", name: "provided", type: "uint256" },
{ internalType: "uint256", name: "minimum", type: "uint256" }
],
name: "AmountTooLow",
type: "error"
},
{ inputs: [], name: "EnforcedPause", type: "error" },
{ inputs: [], name: "ExpectedPause", type: "error" },
{
inputs: [
{ internalType: "uint256", name: "requested", type: "uint256" },
{ internalType: "uint256", name: "available", type: "uint256" }
],
name: "InsufficientStake",
type: "error"
},
{ inputs: [], name: "InvalidBeneficiaryAddress", type: "error" },
{ inputs: [], name: "InvalidSignature", type: "error" },
{ inputs: [], name: "InvalidTokenAddress", type: "error" },
{ inputs: [], name: "InvalidUnstakeRequest", type: "error" },
{ inputs: [], name: "NotPermittedStaker", type: "error" },
{ inputs: [], name: "NotUnstakeOwner", 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: [], name: "ReentrancyGuardReentrantCall", type: "error" },
{
inputs: [{ internalType: "address", name: "token", type: "address" }],
name: "SafeERC20FailedOperation",
type: "error"
},
{
inputs: [
{ internalType: "uint256", name: "currentBlock", type: "uint256" },
{ internalType: "uint256", name: "unlockBlock", type: "uint256" }
],
name: "StillInCooldownPeriod",
type: "error"
},
{ inputs: [], name: "UnstakingNotStarted", type: "error" },
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "previousOwner", type: "address" },
{ indexed: true, internalType: "address", name: "newOwner", type: "address" }
],
name: "OwnershipTransferStarted",
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"
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
name: "Paused",
type: "event"
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "staker", type: "address" },
{ indexed: true, internalType: "address", name: "beneficiary", type: "address" },
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
],
name: "Staked",
type: "event"
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
name: "Unpaused",
type: "event"
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "user", type: "address" },
{ indexed: true, internalType: "uint256", name: "unstakeId", type: "uint256" },
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
],
name: "UnstakeCancelled",
type: "event"
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "user", type: "address" },
{ indexed: true, internalType: "uint256", name: "unstakeId", type: "uint256" },
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" }
],
name: "UnstakeWithdrawn",
type: "event"
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "user", type: "address" },
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
{ indexed: true, internalType: "uint256", name: "unstakeId", type: "uint256" }
],
name: "Unstaked",
type: "event"
},
{ inputs: [], name: "acceptOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
{
inputs: [{ internalType: "uint256", name: "_unstakeId", type: "uint256" }],
name: "cancelUnstake",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "cooldownPeriod",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [
{ internalType: "uint256", name: "_amount", type: "uint256" },
{ internalType: "address", name: "_onBehalfOf", type: "address" },
{ 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: "delegateStake",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [{ internalType: "uint256", name: "unstakeId", type: "uint256" }],
name: "getUnstakeRequest",
outputs: [
{
components: [
{ internalType: "address", name: "owner", type: "address" },
{ internalType: "uint256", name: "amount", type: "uint256" },
{ internalType: "uint256", name: "unlockBlock", type: "uint256" }
],
internalType: "struct ERC20Staking.UnstakeRequest",
name: "",
type: "tuple"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "minStakingAmount",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "nextUnstakeId",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "owner",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{ inputs: [], name: "pause", outputs: [], stateMutability: "nonpayable", type: "function" },
{
inputs: [],
name: "paused",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "pendingOwner",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "permittedStaker",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{ inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
{
inputs: [{ internalType: "address", name: "_permittedStaker", type: "address" }],
name: "setPermittedStaker",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "uint256", name: "_amount", type: "uint256" },
{ internalType: "address", name: "_beneficiary", type: "address" }
],
name: "stake",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [{ internalType: "address", name: "", type: "address" }],
name: "stakes",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "stakingToken",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "totalStaked",
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: [], name: "unpause", outputs: [], stateMutability: "nonpayable", type: "function" },
{
inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
name: "unstake",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
name: "unstakeRequests",
outputs: [
{ internalType: "address", name: "owner", type: "address" },
{ internalType: "uint256", name: "amount", type: "uint256" },
{ internalType: "uint256", name: "unlockBlock", type: "uint256" }
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "unstakingStartBlock",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [{ internalType: "uint256", name: "_unstakeId", type: "uint256" }],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}
] as const;