Hi,
I’m trying to deploy zeppelin’s implementation of ERC777 just as an example. I understand the constructor takes three arguments: name, symbol and an array of addresses (default operators), hence the following 2_another_migrate.js code in truffle:
var MyContract = artifacts.require("./ERC777.sol");
var defaultOperators = ["0xEe545e6239a7e0d42095872956DdC981f028da60","0x3e576F19520215637569c6aCB0740723326d1375", "0x569bd2696200ce347f72cE586B6d355C28E5aAf4"];
module.exports = function(deployer) {
deployer.deploy(MyContract, "TestToken", "TTN", defaultOperators);
}
BUT, when I to run the migration the console says:
“ERC777” hit a require or revert statement somewhere in its constructor. Try:
Verifying that your constructor params satisfy all require conditions.
Adding reason strings to your require statements.
So what exactly should I pass as a third argument? My goal is to eventually deploy it to a test network and interact with it via MEW… any other thing I might be missing here? Thank you
For the record, when testing against a development network like ganache or geth --dev you need to use openzeppelin-test-helpers as shown below.
const { singletons } = require('openzeppelin-test-helpers');
contract('ERC777', function (accounts) {
before(async function () {
const funder = accounts[0]; // account that will be used to fund the deployment
await singletons.ERC1820Registry(funder);
});
it(...your test here...);
});
Configure is still unreleased! You can try it for now by installing the latest code from GitHub directly: npm install github:OpenZeppelin/openzeppelin-test-helpers. The feature will be released on npm likely next week.
Check out the changelog in case there are any breaking changes you need to adapt to.
So yes, it was a problem with node. It stopped throwing a bunch of errors after rolling back to version 10.0.0. Now it only throws one error lol (see above)
This is mine, I just uploaded it now: https://github.com/alanbleier182/777/tree/master
The readme contains everything I did to replicate the bug… I’ll check yours out and see if I can decypher what went wrong. Thanks a bunch!
Here is an example to deploy the ERC1820 registry, using the openzeppelin-test-helpers.
This example deals with multiple migrate --reset inside the truffle console.
Please note that the second step of migration, is for loading the openzeppelin-test-helpers.
There we try to configure it, but if is already configured, an exception is thrown and it is catch.
Then we deploy the ERC1820Registry.
The third step of migration is for deploying the ERC777.