-
Notifications
You must be signed in to change notification settings - Fork 10
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
chore: pull abi #145
chore: pull abi #145
Conversation
|
||
const UPSTREAM_COMMIT_HASH = '8c762559c98b707801f52dd070dd39ab9478b876' | ||
const UPSTREAM_REPO = 'https://raw.githubusercontent.com/cowprotocol/composable-cow' | ||
const ABI_TO_FETCH = ['ComposableCoW', 'ExtensibleFallbackHandler', 'TWAP'] |
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.
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.
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.
Would it be possible to load those artifacts async, only if needed to help trim down the bundle?
const urlsToDownload = ABI_TO_FETCH.map((abi) => { | ||
return `${UPSTREAM_REPO}/${UPSTREAM_COMMIT_HASH}/out/${abi}.sol/${abi}.json` | ||
}) |
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.
Do you need to download the abi?
Feels weird to me that's needed.
Usually in such cases, the upstream source publishes a package with the exposed abi files.
Otherwise we pick only the methods we need in a trimmed down version of the abi.
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.
I think is not bad to just include a copy of the ABI, and remove any method that is not needed.
Almost similar to how in solidity you just create an interface with the dependency you have with some other contract (and you don't make this interface include all the methods of the contract, but just the ones you need).
Closing, with related issue created: cowprotocol/composable-cow#60 |
This PR:
abi
artifacts from the repository, instead depending on upstream commits for the latest.Closes #142