Files
solace-bg-dubai/frontend/lib/web3/contracts.ts
defiQUG a03417be98
All checks were successful
CI / lint-and-test (push) Successful in 9m52s
chore: consolidate local WIP (repo cleanup 20260707)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:38 -07:00

234 lines
7.2 KiB
TypeScript

// Contract addresses (will be set after deployment)
export const CONTRACT_ADDRESSES = {
TreasuryWallet: process.env.NEXT_PUBLIC_TREASURY_WALLET_ADDRESS || "",
SubAccountFactory:
process.env.NEXT_PUBLIC_SUB_ACCOUNT_FACTORY_ADDRESS || "",
};
// ABI exports will be generated from contract compilation
export const TREASURY_WALLET_ABI = [
{
inputs: [
{ internalType: "address[]", name: "_owners", type: "address[]" },
{ internalType: "uint256", name: "_threshold", type: "uint256" },
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "newOwner", type: "address" },
],
name: "OwnerAdded",
type: "event",
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "removedOwner", type: "address" },
],
name: "OwnerRemoved",
type: "event",
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "uint256", name: "proposalId", type: "uint256" },
{ indexed: true, internalType: "address", name: "approver", type: "address" },
],
name: "TransactionApproved",
type: "event",
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "uint256", name: "proposalId", type: "uint256" },
{ indexed: true, internalType: "address", name: "executor", type: "address" },
],
name: "TransactionExecuted",
type: "event",
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "uint256", name: "proposalId", type: "uint256" },
{ indexed: true, internalType: "address", name: "to", type: "address" },
{ indexed: false, internalType: "uint256", name: "value", type: "uint256" },
{ indexed: false, internalType: "bytes", name: "data", type: "bytes" },
{ indexed: false, internalType: "address", name: "proposer", type: "address" },
],
name: "TransactionProposed",
type: "event",
},
{
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
name: "addOwner",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ internalType: "uint256", name: "proposalId", type: "uint256" },
],
name: "approveTransaction",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ internalType: "uint256", name: "proposalId", type: "uint256" },
{ internalType: "address", name: "owner", type: "address" },
],
name: "hasApproved",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "address", name: "", type: "address" }],
name: "isOwner",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owners",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "uint256", name: "value", type: "uint256" },
{ internalType: "bytes", name: "data", type: "bytes" },
],
name: "proposeTransaction",
outputs: [{ internalType: "uint256", name: "proposalId", type: "uint256" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "address", name: "token", type: "address" },
{ internalType: "uint256", name: "value", type: "uint256" },
{ internalType: "bytes", name: "data", type: "bytes" },
],
name: "proposeTokenTransfer",
outputs: [{ internalType: "uint256", name: "proposalId", type: "uint256" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "address", name: "ownerToRemove", type: "address" }],
name: "removeOwner",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "threshold",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ internalType: "uint256", name: "", type: "uint256" },
],
name: "transactions",
outputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "uint256", name: "value", type: "uint256" },
{ internalType: "bytes", name: "data", type: "bytes" },
{ internalType: "bool", name: "executed", type: "bool" },
{ internalType: "uint256", name: "approvalCount", type: "uint256" },
],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "uint256", name: "newThreshold", type: "uint256" }],
name: "changeThreshold",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "uint256", name: "proposalId", type: "uint256" }],
name: "executeTransaction",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "uint256", name: "proposalId", type: "uint256" }],
name: "getTransactionFull",
outputs: [
{ internalType: "address", name: "to", type: "address" },
{ internalType: "address", name: "token", type: "address" },
{ internalType: "uint256", name: "value", type: "uint256" },
{ internalType: "bytes", name: "data", type: "bytes" },
{ internalType: "bool", name: "executed", type: "bool" },
{ internalType: "uint256", name: "approvalCount", type: "uint256" },
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getOwners",
outputs: [{ internalType: "address[]", name: "", type: "address[]" }],
stateMutability: "view",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
] as const;
export const SUB_ACCOUNT_FACTORY_ABI = [
{
anonymous: false,
inputs: [
{ indexed: true, internalType: "address", name: "parentTreasury", type: "address" },
{ indexed: true, internalType: "address", name: "subAccount", type: "address" },
{ indexed: false, internalType: "bytes32", name: "metadataHash", type: "bytes32" },
],
name: "SubAccountCreated",
type: "event",
},
{
inputs: [
{ internalType: "address", name: "parentTreasuryAddress", type: "address" },
{ internalType: "bytes32", name: "metadataHash", type: "bytes32" },
],
name: "createSubAccount",
outputs: [{ internalType: "address", name: "subAccount", type: "address" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "address", name: "parentTreasuryAddress", type: "address" }],
name: "getSubAccounts",
outputs: [{ internalType: "address[]", name: "", type: "address[]" }],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "address", name: "account", type: "address" }],
name: "isSubAccount",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
] as const;