I have a custom proxy. Writing a deployment script for Buidler. Know how to do something in Truffle but not sure how to do the equivalent in Buidler.


let testContract = await deployer.deploy(TestContract);
let customProxy = await deployer.deploy(CustomProxy, testContract.address, <param>);
let testContractCast = await TestContract.at(customProxy.address);


let testContract = await deployContract(wallet, TestContract);
let customProxy = await deployContract(wallet, CustomProxy, [testContract.address, <param>])
let testContractCast = ???

1 Answer 1


I haven't tried this, but it should work according to the documentation. Please let us know if it does indeed work.

As described in https://github.com/nomiclabs/buidler/tree/master/packages/buidler-ethers#environment-extensions, the buidler-ethers plugin adds a getContractAt object to the ethers object.

What that means for you would be

  1. Install the plugin if not yet done.
$ npm install --save-dev @nomiclabs/buidler-ethers 'ethers@^5.0.0'

And add the following statement to your buidler.config.js:

  1. Now you can use it in your script:
const myEthersContract = await ethers.getContractAt(nameOrAbi, atAddress);
  • i'm getting a function selector was not recognized and there's no fallback function error when I do this. Buidler thinks i'm linking up with the proxy abi even though i need to use the implementation contract ABI @markus
    – Michael C
    Commented Oct 14, 2020 at 19:01
  • @MichaelC are you using TestContract.abi for the nameOrAbi ? Commented Oct 14, 2020 at 20:12
  • yes, TestContract.abi
    – Michael C
    Commented Oct 14, 2020 at 20:24
  • the issue was that i was using the receive keyword instead of the fallback keyword in my proxy
    – Michael C
    Commented Oct 14, 2020 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.