Deployment fails when linking solidity library

Hi, I am stumped on deploying locally. We can deploy fine to main net and test nets (Kovan). When I try to deploy locally, creating a local session, and running the following:

npx zos session --network development --from 0x3D01dDdB4eBD0b521f0E4022DCbeF3cb9bc20FF2 --expires 2500

npx zos add XyStakingConsensus XyBlockProducer XyGovernance XyFaucet XyBond PLCRVoting

npx zos push

I get:

[Compiler] Compiling contracts with Truffle…

Compiling your contracts…

Compiling ./contracts/IXyRequester.sol
Compiling ./contracts/Migrations.sol
Compiling ./contracts/PLCR/PLCRVoting.sol
Compiling ./contracts/PLCR/attrstore/AttributeStore.sol
Compiling ./contracts/PLCR/dll/DLL.sol
Compiling ./contracts/XyBlockProducer.sol
Compiling ./contracts/XyGovernance.sol
Compiling ./contracts/XyParameterizer.sol
Compiling ./contracts/XyPayOnDelivery.sol
Compiling ./contracts/access/GovernorRole.sol
Compiling ./contracts/access/Roles.sol
Compiling ./contracts/introspection/ERC165.sol
Compiling ./contracts/introspection/ERC165Checker.sol
Compiling ./contracts/introspection/IERC165.sol
Compiling ./contracts/staking/XyBond.sol
Compiling ./contracts/staking/XyStakingConsensus.sol
Compiling ./contracts/staking/XyStakingModel.sol
Compiling ./contracts/tests/XyBlockProducerMock.sol
Compiling ./contracts/tests/XyConsensusMock.sol
Compiling ./contracts/tests/XyParameterizerMock.sol
Compiling ./contracts/tests/XyPayOnDeliveryMock.sol
Compiling ./contracts/tests/XyStakingMock.sol
Compiling ./contracts/token/ERC20/IApprovalRecipient.sol
Compiling ./contracts/token/ERC20/IERC20.sol
Compiling ./contracts/token/ERC20/IXYOERC20.sol
Compiling ./contracts/token/ERC20/SafeERC20.sol
Compiling ./contracts/token/ERC20/XyERC20Token.sol
Compiling ./contracts/token/ERC20/XyFaucet.sol
Compiling ./contracts/utils/Address.sol
Compiling ./contracts/utils/Initializable.sol
Compiling ./contracts/utils/SafeMath.sol

> compilation warnings encountered:

/Users/kevin/GitHub/xyo/dapp-scsc-solidity/contracts/staking/XyStakingModel.sol:420:5: Warning: Function state mutability can be restricted to pure
function isBondedStake(bytes32) internal view returns (bool) {
^ (Relevant source part starts here and spans across multiple lines).

Artifacts written to /Users/kevin/GitHub/xyo/dapp-scsc-solidity/build/contracts
Compiled successfully using:

  • solc: 0.5.4+commit.9549d8ff.Emscripten.clang

[Session] Using session with network development, sender address 0x3D01dDdB4eBD0b521f0E4022DCbeF3cb9bc20FF2, timeout 600 seconds
[Error] TypeError: Cannot read property ‘DLL’ of undefined
at ZosNetworkFile.solidityLib (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/models/files/ZosNetworkFile.ts:172:34)
at ZosNetworkFile.hasSolidityLib (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/models/files/ZosNetworkFile.ts:189:26)
at libNames.map.filter (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/models/network/NetworkController.ts:172:49)
at Array.filter ()
at NetworkController._solidityLibsForPush (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/models/network/NetworkController.ts:171:8)
at NetworkController. (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/models/network/NetworkController.ts:109:35)
at Generator.next ()
at /Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/models/network/NetworkController.js:7:71
at new Promise ()
at __awaiter (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/models/network/NetworkController.js:3:12)
at NetworkController.push (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/models/network/NetworkController.js:102:16)
at Object. (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/scripts/push.ts:11:22)
at Generator.next ()
at /Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/scripts/push.js:7:71
at new Promise ()
at __awaiter (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/scripts/push.js:3:12)
at Object.push [as default] (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/scripts/push.js:18:12)
at Command. (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/src/commands/push.ts:27:13)
at Generator.next ()
at fulfilled (/Users/kevin/GitHub/xyo/dapp-scsc-solidity/node_modules/zos/lib/commands/push.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)

npx zos --version
2.2.3
3 Likes

Hey Kevin! Is this project open source, so I can take a look at its structure?

2 Likes

for sure! Here it is:

1 Like

Hey @klivin! Sorry for the delay in the response. I checked out your project (on the both the develop and master branches) and could not reproduce your issue with zos 2.2.3. Is the issue still happening? Should I move to a particular commit?

1 Like