You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
I have a contract that I intend to deploy as upgradeable using the OZ CLI as well as with oz capable factories I've written.
When I deploy the using oz deploy -n development and I choose regular. It correctly deploys the contract and links the library associated.
However, when I run the same deployment using upgradeable OZ decides to remove the library contract but it correctly deploys the contract.
If however, I try to deploy the contract before running a "regular" deployment. It fails with "ContractFactroy deployment failed with error: The data field must be HEX encoded data."
No idea why or how this is the case. But it seems to me that OZ does not know how to deploy Solidity Library contracts if they have never been deployed before on a "regular" contract
I am not sure if this is a known bug or not, but I will try to create a minimalist repo to demonstrate the issue.
The text was updated successfully, but these errors were encountered:
// SPDX-License-Identifier: MITpragma solidity^0.6.0;
import"./A.sol";
contractB {
event Stuff(uint256value);
function doStuff() public {
uint256 value = A.doStuff();
emitStuff(value);
}
}
Deploying B as a regular contract also gets the library deployed and linked
$ npx oz deploy
✓ Compiled contracts with solc 0.6.12 (commit.27d51765)
Compilation warnings:
contracts/A.sol:5:5: Warning: Function state mutability can be restricted to pure
function doStuff() public returns (uint256) {
^ (Relevant source part starts here and spans across multiple lines).
? Choose the kind of deployment regular
? Pick a network development
? Pick a contract to deploy B
✓ A library uploaded
✓ Deployed instance of B
0x5b1869D9A4C187F2EAa108f3062412ecf0526b24
Then deploying the contract as upgradeable the library has already been deployed
$ npx oz deploy
Nothing to compile, all contracts are up to date.
? Choose the kind of deployment upgradeable
? Pick a network development
? Pick a contract to deploy B
✓ Contract B deployed
All implementations have been deployed
? Call a function to initialize the instance after creating it? No
✓ Setting everything up to create contract instances
✓ Instance created at 0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb
To upgrade this instance run 'oz upgrade'
0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb
If I restart ganache-cli and remove the build directory and deploy the contract as upgradeable the library gets uploaded
$ npx oz deploy
✓ Compiled contracts with solc 0.6.12 (commit.27d51765)
Compilation warnings:
contracts/A.sol:5:5: Warning: Function state mutability can be restricted to pure
function doStuff() public returns (uint256) {
^ (Relevant source part starts here and spans across multiple lines).
? Choose the kind of deployment upgradeable
? Pick a network development
? Pick a contract to deploy B
✓ A library uploaded
✓ Contract B deployed
All implementations have been deployed
? Call a function to initialize the instance after creating it? No
✓ Setting everything up to create contract instances
✓ Instance created at 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
To upgrade this instance run 'oz upgrade'
0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
The doStuff function works as expected:
$ npx oz send-tx
? Pick a network development
? Pick an instance B at 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
? Select which function doStuff()
✓ Transaction successful. Transaction hash: 0xae938fc3a92d96d02292f33f9ebd10452c538203aea153ee83ffc857ad40a176
Events emitted:
- Stuff(42)
I am running this on the following environment:
oz: 2.8.2
node: v10.21.0
npm: 6.14.7
WSL2 on Windows 10
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a contract that I intend to deploy as upgradeable using the OZ CLI as well as with oz capable factories I've written.
When I deploy the using
oz deploy -n development
and I choose regular. It correctly deploys the contract and links the library associated.However, when I run the same deployment using upgradeable OZ decides to remove the library contract but it correctly deploys the contract.
If however, I try to deploy the contract before running a "regular" deployment. It fails with
"ContractFactroy deployment failed with error: The data field must be HEX encoded data."
No idea why or how this is the case. But it seems to me that OZ does not know how to deploy Solidity Library contracts if they have never been deployed before on a "regular" contract
I am not sure if this is a known bug or not, but I will try to create a minimalist repo to demonstrate the issue.
The text was updated successfully, but these errors were encountered: