1. Set Allowance for the sell token
In order for your order to be tradable, the owner account has to allow the GPv2 Vault Relayer to spend the sell tokens on their behalf (if you are using an existing Balancer v2 approved token or the Balancer Vault's internal balance you may skip this step). You may either set a limited allowance (at least the amount of tokens you intend to sell) or an unlimited allowance (2**256 - 1).
This can either be done using Etherscan, e.g. to set an unlimited allowance for USDC by visiting https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48#writeProxyContract and setting
It can also be done programmatically e.g. using the following ethers typescript snippet:
1
import ERC20 from "@openzeppelin/contracts/build/contracts/ERC20.json";
2
import { Contract, ethers } from "ethers";
3
4
const address =0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48// USDC
5
6
const erc20 = new Contract(address, ERC20.abi, ethers.provider);
7
const tx = await erc20
8
.connect(“your address”)
9
.approve(0xC92E8bdf79f0507f65a392b0ab4667716BFE0110, ethers.constants.MaxUint256);
10
await tx.wait();
Copied!
Copy link