I have incredibly simple code, taking straight from openzeppelin's ERC777 contract. When I run truffle migrate, however, I receive

Replacing 'Implementation'
 *** Deployment Failed ***

"Implementation" 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.

My migration file is as follows

const Implementation = artifacts.require("Implementation");

module.exports = function (deployer) {
    deployer.deploy(Implementation, "Token Name", "TKN", ["0x92DF544228Ca92b8C9943BBeECFDA7D3377f6294"]);

And finally, the solidity code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "@openzeppelin/contracts/token/ERC777/ERC777.sol";

contract Implementation is ERC777 {
        string memory rewardTokenName,
        string memory rewardTokenSymbol,
        address[] memory owners
    ) ERC777(rewardTokenName, rewardTokenSymbol, owners) {}

    function mint(address account, uint256 amount) external {
        require(isOperatorFor(_msgSender(), address(0)), "not contract owner");
        _mint(account, amount, "", "");

I don't see anything wrong with this. And when I run it in Remix and deploy on Goerli it works fine... what's going on with truffle/ganache?


Your Answer

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