npx openzeppelin add results in error message: - Contract Contract.sol not found in path /src/build/contracts/Contract.sol.json
Any suggestions?
Environment
OpenZeppelin SDK 2.7.1, Docker Engine (MacOS) 19.03.5
Details
Docker files, Contract.sol etc below all located in same directory
To reproduce:
docker-compose up -d --build app
and
docker logs test_app_1
…to review log
Output from Docker log:
start oz deploy
{
“name”: “src”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”
},
“keywords”: ,
“author”: “”,
“license”: “ISC”
}
/src
- Project initialized. Write a new contract in the contracts folder and run ‘openzeppelin create’ to deploy it.
{
“manifestVersion”: “2.2”,
“contracts”: {},
“dependencies”: {},
“name”: “patra”,
“version”: “0.1.0”,
“compiler”: {
“compilerSettings”: {
“optimizer”: {}
},
“typechain”: {
“enabled”: false
}
}
}
.:
total 24
drwxr-xr-x 1 root root 4096 Feb 28 19:53 .
drwxr-xr-x 1 root root 4096 Feb 28 19:53 …
drwxr-xr-x 2 root root 4096 Feb 28 19:53 .openzeppelin
drwxr-xr-x 1 root root 4096 Feb 28 19:53 contracts
-rw-r–r-- 1 root root 197 Feb 28 19:53 networks.js
-rw-r–r-- 1 root root 217 Feb 28 19:53 package.json
./.openzeppelin:
total 12
drwxr-xr-x 2 root root 4096 Feb 28 19:53 .
drwxr-xr-x 1 root root 4096 Feb 28 19:53 …
-rw-r–r-- 1 root root 237 Feb 28 19:53 project.json
./contracts:
total 12
drwxr-xr-x 1 root root 4096 Feb 28 19:53 .
drwxr-xr-x 1 root root 4096 Feb 28 19:53 …
-rw-r–r-- 1 root root 184 Feb 28 19:49 Contract.sol
- Compiling contracts with solc 0.5.16 (commit.9c3226ce)
- Compiled contracts with solc 0.5.16 (commit.9c3226ce)
- Contract Contract.sol not found in path /src/build/contracts/Contract.sol.json
Code to reproduce
Contract.sol
pragma solidity ^0.5.16;
contract Contract {
address payable owner;
// persist contract owner for self-destruct feature
constructor() public
{
owner = msg.sender;
}
}
docker-compose.yml:
version: “3”
services:
app:
build: .
Dockerfile:
FROM node:10.19-alpine3.9
RUN apk add --update git python g++ make && \
rm -rf /tmp/* /var/cache/apk/*
RUN npm config set unsafe-perm true && npm -g config set user root && npm install -g @openzeppelin/cli@2.7.1
WORKDIR /src/contracts
COPY ./Contract.sol ./
#WORKDIR /src/build/contracts
WORKDIR /src
RUN npm init -y
#COPY ./project.json ./.openzeppelin
CMD echo ‘start oz deploy’ && cat package.json && pwd && npx openzeppelin init patra --no-interactive && cat ./.openzeppelin/project.json && ls -alR && npx openzeppelin add Contract.sol --no-interactive && ls -alR && echo ‘finish oz deploy’