-
Notifications
You must be signed in to change notification settings - Fork 200
Conversation
For managing solidity lib link
cc908e2
to
b5714ff
Compare
b5714ff
to
762805a
Compare
@jcarpanelli please review the new commits! |
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.
LGTM, no blocking comments :)
"networks": {}, | ||
"schemaVersion": "2.0.1", | ||
"updatedAt": "2018-10-12T10:51:50.530Z" | ||
} |
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.
Is it necessary to publish these build files?
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.
Actual stdlibs libs evm packags have their build artifacts published, so these ones for testing should have them as well.
@@ -1,6 +1,6 @@ | |||
import Truffle from '../models/truffle/Truffle'; | |||
import Session from '../models/network/Session' | |||
import Contracts from 'zos-lib/lib/utils/Contracts'; | |||
import { Contracts } from 'zos-lib'; |
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._checkSolidityLibImplementationAddress(alias, address) | ||
this._checkSolidityLibImplementationBytecode(alias, address, bytecode) | ||
} | ||
//TODO: implement missing remote solidity libs validation |
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.
can we move this to an issue?
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.
|
||
// Verifies if a bytecode represents a solidity library. | ||
export function isSolidityLib(bytecode) { | ||
return bytecode.match(/^0x73[A-Fa-f0-9]{40}3014/) |
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.
we should add a comment explaining why we assume that expected bytecode to be a lib
await Promise.all(_.map(contracts, async ([contractClass, contractAlias]) => { | ||
contractClass.link(libraries); | ||
await project.setImplementation(contractClass, contractAlias); | ||
})); |
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 code is not that clear, +1 to refactor it in a future
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.
Yup, it's on my technical debt workflowy section
@@ -97,6 +97,7 @@ export default { | |||
contract.setProvider(web3.currentProvider) | |||
contract.defaults({ from: web3.eth.accounts[0], ... defaults }) | |||
contract.synchronization_timeout = syncTimeout | |||
contract.setNetwork('test') |
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.
🙌
// run('rm contracts/*.sol ||:') | ||
// run('rm zos.* ||:') | ||
// run('rm package.* ||:') | ||
// }) |
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 we remove this after
statement?
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.
No, I unfortunately forgot to uncomment it. It's no harm though.
Fixes #85
This is a first approach for linking solidity libs before deploying logic contracts.
Implemented so far:
zos.network.json
)zos status ... --fetch
command to compare implementations as both logic contracts and solidity libsStill have to:
zos status ... --fix
command