Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
TypeScript utilities for inspecting and interacting with EIP-1967 and EIP-173 proxy contracts
async function implementationAddress( provider: Provider, proxyAddress: string ): Promise<string>;
async function ownerAddress( provider: Provider, proxyAddress: string ): Promise<string>;
function proxyInterface( proxyAddress: string, signerOrProvider: Signer | Provider ): Contract;
const EIP173_PROXY_ABI = [ "function owner() view returns (address)", "function transferOwnership(address newOwner)", "event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)", ];
keccak256("eip1967.proxy.implementation") - 1
keccak256("eip1967.proxy.admin") - 1
import { implementationAddress, ownerAddress } from "@cowprotocol/contracts"; import { ethers } from "ethers"; const provider = new ethers.providers.JsonRpcProvider("YOUR_RPC_URL"); const proxyAddress = "0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"; const impl = await implementationAddress(provider, proxyAddress); console.log("Implementation:", impl); const owner = await ownerAddress(provider, proxyAddress); console.log("Owner:", owner);
import { proxyInterface } from "@cowprotocol/contracts"; const proxy = proxyInterface(proxyAddress, signer); await proxy.transferOwnership(newOwnerAddress);
Was this page helpful?