-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from studydefi/uma/update-addresses
update addresses for UMA
- Loading branch information
Showing
22 changed files
with
182 additions
and
2,761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
dist | ||
.env | ||
.temp_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@studydefi/money-legos", | ||
"version": "2.2.1", | ||
"version": "2.3.1", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"repository": "[email protected]:studydefi/money-legos.git", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
|
||
// Usage: node scripts/getAbisFromUMA.js <path-to-uma-protocol> | ||
|
||
// only include the following contracts | ||
const fileFilter = [ | ||
"Finder", | ||
"VotingToken", | ||
"IdentifierWhitelist", | ||
"Voting", | ||
"Registry", | ||
"FinancialContractsAdmin", | ||
"Store", | ||
"Governor", | ||
"DesignatedVotingFactory", | ||
"WETH9", | ||
"ExpiringMultiPartyLib", | ||
"TokenFactory", | ||
"AddressWhitelist", | ||
"ExpiringMultiPartyCreator", | ||
]; | ||
|
||
// get all JSON files from their artifacts directory | ||
const inputPath = process.argv[2]; | ||
const artifactPath = path.join(inputPath, "./core/build/contracts"); | ||
const filenames = fs.readdirSync(artifactPath); | ||
|
||
// create a fresh temp folder to hold ABIs | ||
const outputDir = path.join(process.cwd(), "./src/uma/abi"); | ||
if (fs.existsSync(outputDir)) { | ||
fs.rmdirSync(outputDir, { recursive: true }); | ||
} | ||
fs.mkdirSync(outputDir); | ||
|
||
// write ABIs to new files | ||
filenames.forEach((filename) => { | ||
const contents = require(path.join(artifactPath, filename)); | ||
const name = filename.split(".").slice(0, -1).join("."); | ||
|
||
if (fileFilter.includes(name)) { | ||
const outputPath = path.join(outputDir, filename); | ||
fs.writeFileSync(outputPath, JSON.stringify(contents.abi, null, 2)); | ||
console.log("written:", outputPath); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
923885d
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.
Successfully deployed to following URLs: