Files
solace-bg-dubai/frontend/lib/web3/contracts.ts
defiQUG c94eb595f8
Some checks failed
CI / lint-and-test (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:53 -08:00

183 lines
5.4 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: "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: "getTransaction",
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: [],
name: "getOwners",
outputs: [{ internalType: "address[]", name: "", type: "address[]" }],
stateMutability: "view",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
] as const;