Skip to content

Commit

Permalink
Merge pull request #6 from studydefi/master
Browse files Browse the repository at this point in the history
Updating master
  • Loading branch information
marcelomorgado authored Jun 23, 2020
2 parents e061e10 + 0f2c3a5 commit ee5ecb0
Show file tree
Hide file tree
Showing 24 changed files with 199 additions and 1,120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
.env
.temp_*
3 changes: 3 additions & 0 deletions docs/idle.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ List of all available contracts
idle.maxYield.dai.address;
idle.maxYield.usdc.address;
idle.maxYield.usdt.address;
idle.maxYield.susd.address;
idle.maxYield.tusd.address;
idle.maxYield.wbtc.address;

idle.riskAdjusted.dai.address;
idle.riskAdjusted.usdc.address;
Expand Down
2 changes: 1 addition & 1 deletion package.json
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",
Expand Down
47 changes: 47 additions & 0 deletions scripts/getAbisFromUMA.js
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);
}
});
13 changes: 11 additions & 2 deletions src/idle/contracts.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
const contracts = {
maxYield: {
dai: {
address: "0x78751b12da02728f467a44eac40f5cbc16bd7934",
address: "0x78751B12Da02728F467A44eAc40F5cbc16Bd7934",
},
usdc: {
address: "0x12B98C621E8754Ae70d0fDbBC73D6208bC3e3cA6",
},
usdt: {
address: "0x63D27B3DA94A9E871222CB0A32232674B02D2f2D",
},
susd: {
address: "0xE79E177d2a5c7085027d7C64c8F271c81430fc9b",
},
tusd: {
address: "0x51C77689A9c2e8cCBEcD4eC9770a1fA5fA83EeF1",
},
wbtc: {
address: "0xD6f279B7ccBCD70F8be439d25B9Df93AEb60eC55",
},
},
riskAdjusted: {
dai: {
Expand All @@ -18,7 +27,7 @@ const contracts = {
address: "0xcDdB1Bceb7a1979C6caa0229820707429dd3Ec6C",
},
usdt: {
address: "0x42740698959761baf1b06baa51efbd88cb1d862b",
address: "0x42740698959761BAF1B06baa51EfBD88CB1D862B",
},
},
};
Expand Down
15 changes: 5 additions & 10 deletions src/uma/abi/AddressWhitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand Down Expand Up @@ -95,8 +94,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -115,8 +113,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down Expand Up @@ -161,8 +158,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -175,7 +171,6 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
}
]
9 changes: 3 additions & 6 deletions src/uma/abi/DesignatedVotingFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -140,8 +139,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -165,8 +163,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down
2 changes: 1 addition & 1 deletion src/uma/abi/ExpiringMultiParty.json
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@
},
{
"internalType": "uint256",
"name": "requestPassTimestamp",
"name": "withdrawalRequestPassTimestamp",
"type": "uint256"
},
{
Expand Down
21 changes: 7 additions & 14 deletions src/uma/abi/ExpiringMultiPartyCreator.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -69,8 +68,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -83,8 +81,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -97,8 +94,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -124,8 +120,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -138,8 +133,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -158,8 +152,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down
1 change: 1 addition & 0 deletions src/uma/abi/ExpiringMultiPartyLib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
3 changes: 1 addition & 2 deletions src/uma/abi/FinancialContractsAdmin.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand Down
9 changes: 3 additions & 6 deletions src/uma/abi/Finder.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -68,8 +67,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [],
Expand Down Expand Up @@ -126,7 +124,6 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
}
]
24 changes: 8 additions & 16 deletions src/uma/abi/Governor.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -199,8 +198,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -224,8 +222,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand All @@ -244,8 +241,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down Expand Up @@ -320,8 +316,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down Expand Up @@ -369,8 +364,7 @@
"name": "executeProposal",
"outputs": [],
"stateMutability": "payable",
"type": "function",
"payable": true
"type": "function"
},
{
"inputs": [],
Expand All @@ -383,8 +377,7 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
},
{
"inputs": [
Expand Down Expand Up @@ -432,7 +425,6 @@
}
],
"stateMutability": "view",
"type": "function",
"constant": true
"type": "function"
}
]
Loading

0 comments on commit ee5ecb0

Please sign in to comment.