OpenZeppelin / openzeppelin-sdk

OpenZeppelin SDK repository for CLI and upgrades.js. No longer actively developed.
MIT License
431 stars 200 forks source link

ENOENT: no such file or directory, open 'token-exchange/build/contracts/StandaloneERC20.json' #1519

Closed abcoathup closed 4 years ago

abcoathup commented 4 years ago

Cannot deploy StandaloneERC20 from OpenZeppelin Contracts Ethereum Package

Reported by MemeConscious on Telegram

Steps to reproduce, follow Learn guide: https://docs.openzeppelin.com/cli/2.8/dependencies#creating-an-erc20-token

Using OpenZeppelin CLI 2.8 and OpenZeppelin Contracts Ethereum Package 2.5

Deploy

$ npx oz deploy
No contracts found to compile.
? Choose the kind of deployment upgradeable
? Pick a network development
? Pick a contract to deploy @openzeppelin/contracts-ethereum-package/StandaloneERC20
✓ Deploying @openzeppelin/contracts-ethereum-package dependency to network dev-1585550857312
All implementations are up to date
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize(name: string, symbol: string, decimals: uint8, initialSupply: uint256, initialHolde
r: address, minters: address[], pausers: address[])
? name: string: MyToken
? symbol: string: MYT
? decimals: uint8: 18
? initialSupply: uint256: 100e18
? initialHolder: address: 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
? minters: address[]:
? pausers: address[]:
✓ Setting everything up to create contract instances
✓ Instance created at 0x22d5C8BdD4346b390014a07109a8F830094d4abf
/home/projects/forum/token-exchange/build/contracts/StandaloneERC20.json: ENOENT: no such file or directory, open '/home/abcoathup/projects/forum/token-exchange/build/contracts/StandaloneERC20.json'

Deploy (Verbose)

$ npx oz deploy --verbose
[2020-03-30T07:13:54.520Z@SolidityProjectCompiler.js#call] <started> Nothing to compile, all contracts are up to date.
[2020-03-30T07:13:54.522Z@ProjectFile.js#write] <started> Updated /home/abcoathup/projects/forum/token-exchange/.openzeppelin/project.json
? Choose the kind of deployment upgradeable
? Pick a network development
? Pick a contract to deploy @openzeppelin/contracts-ethereum-package/StandaloneERC20
[2020-03-30T07:14:02.515Z@NetworkController.js#deployDependencyIfNeeded] <started> Deploying @openzeppelin/contracts-ethereum-package dependency to network dev-1585552425600
[2020-03-30T07:14:02.625Z@Package.js#deploy] <started> Deployed Package 0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab
[2020-03-30T07:14:02.721Z@ImplementationDirectory.js#deploy] <started> Deployed ImplementationDirectory at 0x5b1869D9A4C187F2EAa108f3062412ecf0526b24
[2020-03-30T07:14:02.829Z@BasePackageProject.js#setImplementation] <started> Setting implementation of StandaloneERC20 in directory
[2020-03-30T07:14:02.829Z@BasePackageProject.js#setImplementation] <started> Setting implementation of StandaloneERC721 in directory
[2020-03-30T07:14:02.829Z@BasePackageProject.js#setImplementation] <started> Setting implementation of TokenVesting in directory
[2020-03-30T07:14:02.830Z@BasePackageProject.js#setImplementation] <started> Setting implementation of PaymentSplitter in directory
[2020-03-30T07:14:03.062Z@ImplementationDirectory.js#setImplementation] <started> Setting StandaloneERC20 implementation 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B in directory
[2020-03-30T07:14:03.065Z@ImplementationDirectory.js#setImplementation] <started> Setting StandaloneERC721 implementation 0xC89Ce4735882C9F0f0FE26686c53074E09B0D550 in directory
[2020-03-30T07:14:03.070Z@ImplementationDirectory.js#setImplementation] <started> Setting TokenVesting implementation 0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb in directory
[2020-03-30T07:14:03.077Z@ImplementationDirectory.js#setImplementation] <started> Setting PaymentSplitter implementation 0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7 in directory
[2020-03-30T07:14:03.232Z@ImplementationDirectory.js#setImplementation] <succeeded> Setting StandaloneERC20 in directory
[2020-03-30T07:14:03.232Z@BasePackageProject.js#setImplementation] <started> Implementation set: 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
[2020-03-30T07:14:03.241Z@ImplementationDirectory.js#setImplementation] <succeeded> Setting StandaloneERC721 in directory
[2020-03-30T07:14:03.241Z@BasePackageProject.js#setImplementation] <started> Implementation set: 0xC89Ce4735882C9F0f0FE26686c53074E09B0D550
[2020-03-30T07:14:03.247Z@ImplementationDirectory.js#setImplementation] <succeeded> Setting TokenVesting in directory
[2020-03-30T07:14:03.247Z@BasePackageProject.js#setImplementation] <started> Implementation set: 0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb
[2020-03-30T07:14:03.253Z@ImplementationDirectory.js#setImplementation] <succeeded> Setting PaymentSplitter in directory
[2020-03-30T07:14:03.253Z@BasePackageProject.js#setImplementation] <started> Implementation set: 0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7
[2020-03-30T07:14:03.254Z@NetworkController.js#deployDependencyIfNeeded] <succeeded> Deploying @openzeppelin/contracts-ethereum-package dependency to network dev-1585552425600
[2020-03-30T07:14:03.260Z@NetworkController.js#linkDependency] <started> Using custom deployment of @openzeppelin/contracts-ethereum-package
[2020-03-30T07:14:03.260Z@NetworkController.js#push] <started> All implementations are up to date
[2020-03-30T07:14:03.261Z@NetworkFile.js#write] <started> Created .openzeppelin/dev-1585552425600.json
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize(name: string, symbol: string, decimals: uint8, initialSupply: uint256, initialHolde
r: address, minters: address[], pausers: address[])
? name: string: MyToken
? symbol: string: MYT
? decimals: uint8: 18
? initialSupply: uint256: 100e18
? initialHolder: address: 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
? minters: address[]:
? pausers: address[]:
[2020-03-30T07:14:40.418Z@ProxyAdmin.js#deploy] <started> Setting everything up to create contract instances
[2020-03-30T07:14:40.497Z@ProxyAdmin.js#deploy] <succeeded> Setting everything up to create contract instances
[2020-03-30T07:14:40.564Z@BaseSimpleProject.js#_getAndLogInitCallData] <started> Creating instance for contract at 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B and calling 'initialize' with:
- name (string): "MyToken"
- symbol (string): "MYT"
- decimals (uint8): "18"
- initialSupply (uint256): "100000000000000000000"
- initialHolder (address): "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1"
- minters (address[]): []
- pausers (address[]): []
[2020-03-30T07:14:40.699Z@BaseSimpleProject.js#_getAndLogInitCallData] <succeeded> Instance created at 0x2612Af3A521c2df9EAF28422Ca335b04AdF3ac66
[2020-03-30T07:14:40.709Z@NetworkFile.js#write] <started> Updated /home/abcoathup/projects/forum/token-exchange/.openzeppelin/dev-1585552425600.json
[2020-03-30T07:14:40.709Z@errors.js#call] <started> Error: /home/abcoathup/projects/forum/token-exchange/build/contracts/StandaloneERC20.json: ENOENT: no such file or directory, open '/home/abcoathup/projects/forum/token-exchange/build/contracts/StandaloneERC20.json'
    at Object.openSync (fs.js:443:3)
    at Object.readFileSync (fs.js:343:35)
    at Object.readFileSync (/home/abcoathup/projects/forum/token-exchange/node_modules/jsonfile/index.js:61:22)
    at NetworkController.<anonymous> (/home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:694:49)
    at Generator.next (<anonymous>)
    at /home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:4:12)
    at NetworkController._updateTruffleDeployedInformation (/home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:690:16)
    at NetworkController.<anonymous> (/home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:553:28)
    at Generator.next (<anonymous>)
    at fulfilled (/home/abcoathup/projects/forum/token-exchange/node_modules/@openzeppelin/cli/lib/models/network/NetworkController.js:5:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
frangio commented 4 years ago

Duplicate of https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1516.

frangio commented 4 years ago

This has been fixed in CLI 2.8.1