Skip to content

Commit

Permalink
PaymentSplitter ABI (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiep-immutable authored Aug 28, 2024
1 parent 8a86c1d commit 63bd4db
Show file tree
Hide file tree
Showing 3 changed files with 363 additions and 1 deletion.
350 changes: 350 additions & 0 deletions abi/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2416,3 +2416,353 @@ export const immutableErc721MintByIdAbi = [
name: 'TransferToNotInAllowlist',
},
] as const

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PaymentSplitter
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

export const paymentSplitterAbi = [
{
type: 'constructor',
inputs: [
{ name: 'admin', internalType: 'address', type: 'address' },
{ name: 'registrar', internalType: 'address', type: 'address' },
{ name: 'fundsAdmin', internalType: 'address', type: 'address' },
],
stateMutability: 'nonpayable',
},
{ type: 'receive', stateMutability: 'payable' },
{
type: 'function',
inputs: [],
name: 'DEFAULT_ADMIN_ROLE',
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'RELEASE_FUNDS_ROLE',
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'TOKEN_REGISTRAR_ROLE',
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [
{ name: 'tokens', internalType: 'contract IERC20[]', type: 'address[]' },
],
name: 'addToAllowlist',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [],
name: 'erc20Allowlist',
outputs: [
{ name: '', internalType: 'contract IERC20[]', type: 'address[]' },
],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }],
name: 'getRoleAdmin',
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32' },
{ name: 'index', internalType: 'uint256', type: 'uint256' },
],
name: 'getRoleMember',
outputs: [{ name: '', internalType: 'address', type: 'address' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }],
name: 'getRoleMemberCount',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'user', internalType: 'address', type: 'address' }],
name: 'grantReleaseFundsRole',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32' },
{ name: 'account', internalType: 'address', type: 'address' },
],
name: 'grantRole',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32' },
{ name: 'account', internalType: 'address', type: 'address' },
],
name: 'hasRole',
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [
{ name: 'payees', internalType: 'address payable[]', type: 'address[]' },
{ name: 'shares_', internalType: 'uint256[]', type: 'uint256[]' },
],
name: 'overridePayees',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [{ name: 'index', internalType: 'uint256', type: 'uint256' }],
name: 'payee',
outputs: [{ name: '', internalType: 'address', type: 'address' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
name: 'releasable',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [
{ name: 'token', internalType: 'contract IERC20', type: 'address' },
{ name: 'account', internalType: 'address', type: 'address' },
],
name: 'releasable',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'releaseAll',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [
{ name: 'token', internalType: 'contract IERC20', type: 'address' },
],
name: 'removeFromAllowlist',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32' },
{ name: 'account', internalType: 'address', type: 'address' },
],
name: 'renounceRole',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [{ name: 'user', internalType: 'address', type: 'address' }],
name: 'revokeReleaseFundsRole',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32' },
{ name: 'account', internalType: 'address', type: 'address' },
],
name: 'revokeRole',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
name: 'shares',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }],
name: 'supportsInterface',
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'totalShares',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'token',
internalType: 'contract IERC20',
type: 'address',
indexed: true,
},
{ name: 'to', internalType: 'address', type: 'address', indexed: false },
{
name: 'amount',
internalType: 'uint256',
type: 'uint256',
indexed: false,
},
],
name: 'ERC20PaymentReleased',
},
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'account',
internalType: 'address',
type: 'address',
indexed: false,
},
{
name: 'shares',
internalType: 'uint256',
type: 'uint256',
indexed: false,
},
],
name: 'PayeeAdded',
},
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'from',
internalType: 'address',
type: 'address',
indexed: false,
},
{
name: 'amount',
internalType: 'uint256',
type: 'uint256',
indexed: false,
},
],
name: 'PaymentReceived',
},
{
type: 'event',
anonymous: false,
inputs: [
{ name: 'to', internalType: 'address', type: 'address', indexed: false },
{
name: 'amount',
internalType: 'uint256',
type: 'uint256',
indexed: false,
},
],
name: 'PaymentReleased',
},
{
type: 'event',
anonymous: false,
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
{
name: 'previousAdminRole',
internalType: 'bytes32',
type: 'bytes32',
indexed: true,
},
{
name: 'newAdminRole',
internalType: 'bytes32',
type: 'bytes32',
indexed: true,
},
],
name: 'RoleAdminChanged',
},
{
type: 'event',
anonymous: false,
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
{
name: 'account',
internalType: 'address',
type: 'address',
indexed: true,
},
{
name: 'sender',
internalType: 'address',
type: 'address',
indexed: true,
},
],
name: 'RoleGranted',
},
{
type: 'event',
anonymous: false,
inputs: [
{ name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
{
name: 'account',
internalType: 'address',
type: 'address',
indexed: true,
},
{
name: 'sender',
internalType: 'address',
type: 'address',
indexed: true,
},
],
name: 'RoleRevoked',
},
{
type: 'error',
inputs: [],
name: 'PaymentSplitterLengthMismatchSharesPayees',
},
{ type: 'error', inputs: [], name: 'PaymentSplitterNoPayeesAdded' },
{ type: 'error', inputs: [], name: 'PaymentSplitterPayeeZeroShares' },
{ type: 'error', inputs: [], name: 'PaymentSplitterPayeeZerothAddress' },
{
type: 'error',
inputs: [],
name: 'PaymentSplitterSharesAlreadyExistForPayee',
},
] as const
9 changes: 8 additions & 1 deletion abi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import {
immutableErc721Abi as ImmutableERC721Abi,
immutableErc721MintByIdAbi as ImmutableERC721MintByIdAbi,
immutableErc1155Abi as ImmutableERC1155Abi,
paymentSplitterAbi as PaymentSplitterAbi,
} from "./generated";

export { GuardedMulticallerAbi, ImmutableERC721Abi, ImmutableERC721MintByIdAbi, ImmutableERC1155Abi };
export {
GuardedMulticallerAbi,
ImmutableERC721Abi,
ImmutableERC721MintByIdAbi,
ImmutableERC1155Abi,
PaymentSplitterAbi,
};
5 changes: 5 additions & 0 deletions wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GuardedMulticaller from "./foundry-out/GuardedMulticaller.sol/GuardedMult
import ImmutableERC721 from "./foundry-out/ImmutableERC721.sol/ImmutableERC721.json";
import ImmutableERC721MintByID from "./foundry-out/ImmutableERC721MintByID.sol/ImmutableERC721MintByID.json";
import ImmutableERC1155 from "./foundry-out/ImmutableERC1155.sol/ImmutableERC1155.json";
import PaymentSplitter from "./foundry-out/PaymentSplitter.sol/PaymentSplitter.json";

// https://github.com/wevm/viem/discussions/1009
export default defineConfig({
Expand All @@ -26,5 +27,9 @@ export default defineConfig({
name: "ImmutableERC1155",
abi: ImmutableERC1155.abi as Abi,
},
{
name: "PaymentSplitter",
abi: PaymentSplitter.abi as Abi,
},
],
});

0 comments on commit 63bd4db

Please sign in to comment.