-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Martinvol/isolate 0.8 artifacts for gasPriceMinimum #10437
Martinvol/isolate 0.8 artifacts for gasPriceMinimum #10437
Conversation
… (bc they were not updated)
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: @summa-tx/[email protected] |
try { | ||
contractArtifact = await artifacts.require(contractName) // I think it won't be able to find GasPriceMinimum here | ||
} catch { | ||
// it wasn't found in the standar artifacts folder, check if it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be generalized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Made a few comment.
To keep the protocol folder structure simple, would it be possible to organize contracts
with a subdirectory for v0.5
& v0.8
.
@@ -0,0 +1,77 @@ | |||
// SPDX-License-Identifier: MIT | |||
// Original authors: https://github.com/summa-tx/memview-sol | |||
pragma solidity >=0.5.10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this version be updated to pragma solidity >=0.5.10 <0.8.0;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
@@ -68,43 +57,7 @@ contract UsingRegistry is Ownable { | |||
emit RegistrySet(registryAddress); | |||
} | |||
|
|||
function getAccounts() internal view returns (IAccounts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, why does this remove a bunch of the getters?
Also, is there a reason this is modeled after the original UsingRegistry rather than the more efficient UsingRegistryV2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done like this so I didn't have to make the interfaces have permissive pragmas.
Regarding the UsingRegistryV2, I'm not sure, the first implementation used this one, but I'll take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but now thinking about this, we already have flexible pragmas and everything lands in the right folder, so I guess I could bring it back. Will try that, thanks for the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remembered why not all getters could are there, because Mento's ones can be used with 0.8.
It is not using UsingRegistryV2 because gasPriceMinimum is using UsingRegistry.
packages/protocol/lib/bytecode.ts
Outdated
console.log("this.addresses[library]", this.addresses[library]) | ||
console.log("address", address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug logs to be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I'm done :)
(verify release still doesn't work)
reportIndex.libraries[contract] = changesByContract[contract] | ||
} else { | ||
const report = ASTVersionedReport.create(changesByContract[contract]) | ||
reportIndex.contracts[contract] = report | ||
} | ||
}) | ||
console.log("made it here b") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here and elsewhere, but I guess it's still a WIP PR.
…/celo-monorepo into martinvol/isolate-0.8-artifacts
…/celo-monorepo into martinvol/isolate-0.8-artifacts
@@ -28,7 +28,7 @@ testWithGanache('releasegold:withdraw cmd', (web3: Web3) => { | |||
test('can withdraw released gold to beneficiary', async () => { | |||
await testLocally(SetLiquidityProvision, ['--contract', contractAddress, '--yesreally']) | |||
// ReleasePeriod of default contract | |||
await timeTravel(100000000, web3) | |||
await timeTravel(300000000, web3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is cherry-picked from master, right @pahor167
Description
This PR fixes key features of our tooling to enable the tooling to be able to deploy 0.8 Solidity. The keys to the approach are:
a. The reason to have separate folders is that if a contract is built, it compiles all its dependencies with the solidity version of the contract, but if those were already built for a different smart contract, the artifacts get overwritten, making the storage check fail.
SafeMath
), that were overwriting or own, and thus causing problems.TODO:
verify-deployed
,verify-release
works,make-release
andcheck-versions
work. (Volpe: I tested it but right before merging it should be done again)Other changes
Describe any minor or "drive-by" changes here.
Tested
An explanation of how the changes were tested or an explanation as to why they don't need to be.
Related issues
Backwards compatibility
Brief explanation of why these changes are/are not backwards compatible.
Documentation
The set of community facing docs that have been added/modified because of this change