-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add handler and tests for CarrotStaker contract
- Loading branch information
Showing
4 changed files
with
568 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,348 @@ | ||
export const CarrotStaker = <const>[ | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: 'carrot', type: 'address' }, | ||
{ internalType: 'address', name: 'initialOwner', type: 'address' }, | ||
], | ||
stateMutability: 'nonpayable', | ||
type: 'constructor', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: 'spender', type: 'address' }, | ||
{ internalType: 'uint256', name: 'allowance', type: 'uint256' }, | ||
{ internalType: 'uint256', name: 'needed', type: 'uint256' }, | ||
], | ||
name: 'ERC20InsufficientAllowance', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: 'sender', type: 'address' }, | ||
{ internalType: 'uint256', name: 'balance', type: 'uint256' }, | ||
{ internalType: 'uint256', name: 'needed', type: 'uint256' }, | ||
], | ||
name: 'ERC20InsufficientBalance', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'approver', type: 'address' }], | ||
name: 'ERC20InvalidApprover', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'receiver', type: 'address' }], | ||
name: 'ERC20InvalidReceiver', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], | ||
name: 'ERC20InvalidSender', | ||
type: 'error', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'spender', type: 'address' }], | ||
name: 'ERC20InvalidSpender', | ||
type: 'error', | ||
}, | ||
{ inputs: [], name: 'InvalidAddress', type: 'error' }, | ||
{ inputs: [], name: 'MethodNotAllowed', 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: 'UnauthorizedUnstakeEnable', type: 'error' }, | ||
{ inputs: [], name: 'UnstakingNotAllowed', 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: 'value', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'Approval', | ||
type: 'event', | ||
}, | ||
{ | ||
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: true, | ||
internalType: 'address', | ||
name: 'staker', | ||
type: 'address', | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: 'uint256', | ||
name: 'amount', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'Staked', | ||
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: true, | ||
internalType: 'address', | ||
name: 'staker', | ||
type: 'address', | ||
}, | ||
{ | ||
indexed: true, | ||
internalType: 'address', | ||
name: 'recipient', | ||
type: 'address', | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: 'uint256', | ||
name: 'amount', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'Unstaked', | ||
type: 'event', | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: false, internalType: 'bool', name: 'allowed', type: 'bool' }, | ||
], | ||
name: 'UnstakingAllowed', | ||
type: 'event', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'CARROT', | ||
outputs: [{ internalType: 'contract IERC20', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'UNSTAKING_OPEN_TIMESTAMP', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'acceptOwnership', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'allowUnstake', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
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: '', type: 'address' }, | ||
{ internalType: 'uint256', name: '', type: 'uint256' }, | ||
], | ||
name: 'approve', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'account', type: 'address' }], | ||
name: 'balanceOf', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'decimals', | ||
outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'isUnstakingAllowed', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'name', | ||
outputs: [{ internalType: 'string', name: '', type: 'string' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'owner', | ||
outputs: [{ internalType: 'address', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'pendingOwner', | ||
outputs: [{ internalType: 'address', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'renounceOwnership', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }], | ||
name: 'stake', | ||
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: '', type: 'uint256' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '', type: 'address' }, | ||
{ internalType: 'uint256', name: '', type: 'uint256' }, | ||
], | ||
name: 'transfer', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '', type: 'address' }, | ||
{ internalType: 'address', name: '', type: 'address' }, | ||
{ internalType: 'uint256', name: '', type: 'uint256' }, | ||
], | ||
name: 'transferFrom', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], | ||
name: 'transferOwnership', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'uint256', name: 'amount', type: 'uint256' }, | ||
{ internalType: 'address', name: 'recipient', type: 'address' }, | ||
], | ||
name: 'unstake', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.