New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment of ERC777 with Truffle Migrations doesn't work. #1743
Comments
Thank you for reporting this @crazyrabbitLTC! We definitely want to get this to work more like an out of the box experience, so we're looking into it. I think that using the deployer in openzeppelin-test-helpers should be the recommended way, but it's not working due to OpenZeppelin/openzeppelin-test-helpers#35. |
@crazyrabbitLTC There's a fix for this in OpenZeppelin/openzeppelin-test-helpers#38. You can try it with
You will then be able to require('openzeppelin-test-helpers/configure')({ web3 }) |
Hi @frangio , for: npm install frangio/openzeppelin-test-helpers#reduce-dependencies is the "#reduce-dependencies" intentional? I'm getting this error:
I tried without, but I still have the: So I assume I'm still missing something. My new deployment code looks like this: (but does not work)
|
Yes it was intentional but we just merged the PR so I deleted the branch and forgot to update this comment. Sorry! Updated the comment above now.
Let me know if you have any other issues! |
@crazyrabbitLTC I think you have a bug in your migrations code though. The function you export in the migration receives three arguments and const ERC777 = artifacts.require('ERC777');
require('openzeppelin-test-helpers/configure')({ web3 });
const { singletons } = require('openzeppelin-test-helpers');
const name = "LuckyToken";
const symbol = "LT";
const defaultOperators = [];
module.exports = async function(deployer, network, accounts) {
const erc1820 = await singletons.ERC1820Registry(accounts[0]);
deployer.deploy(ERC777, name, symbol, defaultOperators);
}; |
A requirement to deploy ERC777 requires a local instance of ERC1820 to be deployed, which does not exist on a local Test network.
There are several issues here:
1: ERC777 fails to deploy, but does not communicate to the user the reason why it failed. No revert/require statements fail with a description why. It is not communicated with the user that the lack of an ERC1820 contract is the problem.
2: Deployment of ERC1820 via the
OpenZeppelin-test-helpers
in migrations does not work as Truffle Migrations does not seem to be able to properly require inopenzeppelin-test-helpers
Because of this, it is unclear of the best way to deploy ERC777 using truffle migrations. Perhaps an external 'setup script' needs to be created.
💻 Environment
Mac OSX Mojave, zsh terminal
OpenZeppelin: openzeppelin-solidity@next (Next at time of this issue filing)
Truffle v5.0.13
📝 Details
Solidity code:
Migrations code:
🔢 Code to reproduce bug
The example above will not deploy an ERC777 token, it is unclear how to deploy a ERC777 in a standard method using Truffle Migrations.
The text was updated successfully, but these errors were encountered: