-
Notifications
You must be signed in to change notification settings - Fork 218
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 #6 from studydefi/master
Updating master
- Loading branch information
Showing
24 changed files
with
199 additions
and
1,120 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
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.4", | ||
"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,47 @@ | ||
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", | ||
"ExpiringMultiParty", | ||
"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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
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
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.