diff --git a/.gitignore b/.gitignore index 9c97bbd..cc44dc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist .env +.temp_* diff --git a/package.json b/package.json index ba98232..8604664 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@studydefi/money-legos", - "version": "2.2.1", + "version": "2.3.1", "main": "index.js", "types": "index.d.ts", "repository": "git@github.com:studydefi/money-legos.git", diff --git a/scripts/getAbisFromUMA.js b/scripts/getAbisFromUMA.js new file mode 100644 index 0000000..e3b7058 --- /dev/null +++ b/scripts/getAbisFromUMA.js @@ -0,0 +1,46 @@ +const path = require("path"); +const fs = require("fs"); + +// Usage: node scripts/getAbisFromUMA.js + +// 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); + } +}); diff --git a/src/uma/abi/AddressWhitelist.json b/src/uma/abi/AddressWhitelist.json index 449faee..fbdeeaa 100644 --- a/src/uma/abi/AddressWhitelist.json +++ b/src/uma/abi/AddressWhitelist.json @@ -55,8 +55,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -95,8 +94,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -115,8 +113,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -161,8 +158,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -175,7 +171,6 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" } ] \ No newline at end of file diff --git a/src/uma/abi/DesignatedVotingFactory.json b/src/uma/abi/DesignatedVotingFactory.json index ea05cef..8014ca6 100644 --- a/src/uma/abi/DesignatedVotingFactory.json +++ b/src/uma/abi/DesignatedVotingFactory.json @@ -120,8 +120,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -140,8 +139,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -165,8 +163,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/abi/ExpiringMultiParty.json b/src/uma/abi/ExpiringMultiParty.json deleted file mode 100644 index 2e83f04..0000000 --- a/src/uma/abi/ExpiringMultiParty.json +++ /dev/null @@ -1,1641 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawalLiveness", - "type": "uint256" - }, - { - "internalType": "address", - "name": "collateralAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "finderAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenFactoryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "timerAddress", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "priceFeedIdentifier", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "syntheticName", - "type": "string" - }, - { - "internalType": "string", - "name": "syntheticSymbol", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "minSponsorTokens", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "liquidationLiveness", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralRequirement", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "disputeBondPct", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "sponsorDisputeRewardPct", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "disputerDisputeRewardPct", - "type": "tuple" - } - ], - "internalType": "struct Liquidatable.ConstructorParams", - "name": "params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "ContractExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "disputer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "disputeSucceeded", - "type": "bool" - } - ], - "name": "DisputeSettled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "originalExpirationTimestamp", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shutdownTimestamp", - "type": "uint256" - } - ], - "name": "EmergencyShutdown", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "EndedSponsorPosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "FinalFeesPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensOutstanding", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lockedCollateral", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "liquidatedCollateral", - "type": "uint256" - } - ], - "name": "LiquidationCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "disputer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "disputeBondAmount", - "type": "uint256" - } - ], - "name": "LiquidationDisputed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "enum Liquidatable.Status", - "name": "liquidationStatus", - "type": "uint8" - } - ], - "name": "LiquidationWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "NewSponsor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "PositionCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "Redeem", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "regularFee", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "lateFee", - "type": "uint256" - } - ], - "name": "RegularFeesPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldSponsor", - "type": "address" - } - ], - "name": "RequestTransferPosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldSponsor", - "type": "address" - } - ], - "name": "RequestTransferPositionCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldSponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newSponsor", - "type": "address" - } - ], - "name": "RequestTransferPositionExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "RequestWithdrawal", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "RequestWithdrawalCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "RequestWithdrawalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralReturned", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokensBurned", - "type": "uint256" - } - ], - "name": "SettleExpiredPosition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "Withdrawal", - "type": "event" - }, - { - "inputs": [], - "name": "cancelTransferPosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "cancelWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "collateralCurrency", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "collateralRequirement", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "contractState", - "outputs": [ - { - "internalType": "enum PricelessPositionManager.ContractState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "numTokens", - "type": "tuple" - } - ], - "name": "create", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "minCollateralPerToken", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "maxCollateralPerToken", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "maxTokensToLiquidate", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - } - ], - "name": "createLiquidation", - "outputs": [ - { - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "tokensLiquidated", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "finalFeeBond", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "cumulativeFeeMultiplier", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - } - ], - "name": "depositTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "dispute", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "totalPaid", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "disputeBondPct", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disputerDisputeRewardPct", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "emergencyShutdown", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "expirationTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "expire", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "expiryPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "finder", - "outputs": [ - { - "internalType": "contract FinderInterface", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "getCollateral", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "getLiquidations", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "internalType": "enum Liquidatable.Status", - "name": "state", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "liquidationTime", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "tokensOutstanding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "lockedCollateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "liquidatedCollateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "rawUnitCollateral", - "type": "tuple" - }, - { - "internalType": "address", - "name": "disputer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "settlementPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "finalFee", - "type": "tuple" - } - ], - "internalType": "struct Liquidatable.LiquidationData[]", - "name": "liquidationData", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "liquidationLiveness", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "liquidations", - "outputs": [ - { - "internalType": "address", - "name": "sponsor", - "type": "address" - }, - { - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "internalType": "enum Liquidatable.Status", - "name": "state", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "liquidationTime", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "tokensOutstanding", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "lockedCollateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "liquidatedCollateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "rawUnitCollateral", - "type": "tuple" - }, - { - "internalType": "address", - "name": "disputer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "settlementPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "finalFee", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minSponsorTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "payRegularFees", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "totalPaid", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "pfc", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "positions", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "tokensOutstanding", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "requestPassTimestamp", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "withdrawalRequestAmount", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "rawCollateral", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "transferPositionRequestPassTimestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "priceIdentifier", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rawLiquidationCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rawTotalPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "numTokens", - "type": "tuple" - } - ], - "name": "redeem", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "amountWithdrawn", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "remargin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "requestTransferPosition", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - } - ], - "name": "requestWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "time", - "type": "uint256" - } - ], - "name": "setCurrentTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "settleExpired", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "amountWithdrawn", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "sponsorDisputeRewardPct", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "timerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenCurrency", - "outputs": [ - { - "internalType": "contract ExpandedIERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalPositionCollateral", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "totalCollateral", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalTokensOutstanding", - "outputs": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newSponsorAddress", - "type": "address" - } - ], - "name": "transferPositionPassedRequest", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "collateralAmount", - "type": "tuple" - } - ], - "name": "withdraw", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "amountWithdrawn", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "liquidationId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sponsor", - "type": "address" - } - ], - "name": "withdrawLiquidation", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "amountWithdrawn", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawPassedRequest", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "rawValue", - "type": "uint256" - } - ], - "internalType": "struct FixedPoint.Unsigned", - "name": "amountWithdrawn", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalLiveness", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/src/uma/abi/ExpiringMultiPartyCreator.json b/src/uma/abi/ExpiringMultiPartyCreator.json index 3d940cf..27402f8 100644 --- a/src/uma/abi/ExpiringMultiPartyCreator.json +++ b/src/uma/abi/ExpiringMultiPartyCreator.json @@ -55,8 +55,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -69,8 +68,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -83,8 +81,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -97,8 +94,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -124,8 +120,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -138,8 +133,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -158,8 +152,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/abi/ExpiringMultiPartyLib.json b/src/uma/abi/ExpiringMultiPartyLib.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/src/uma/abi/ExpiringMultiPartyLib.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/src/uma/abi/FinancialContractsAdmin.json b/src/uma/abi/FinancialContractsAdmin.json index 73a04a8..8d1889c 100644 --- a/src/uma/abi/FinancialContractsAdmin.json +++ b/src/uma/abi/FinancialContractsAdmin.json @@ -29,8 +29,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], diff --git a/src/uma/abi/Finder.json b/src/uma/abi/Finder.json index a9a0d97..8b7cc59 100644 --- a/src/uma/abi/Finder.json +++ b/src/uma/abi/Finder.json @@ -54,8 +54,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -68,8 +67,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -126,7 +124,6 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" } ] \ No newline at end of file diff --git a/src/uma/abi/Governor.json b/src/uma/abi/Governor.json index e1f14b3..517f094 100644 --- a/src/uma/abi/Governor.json +++ b/src/uma/abi/Governor.json @@ -179,8 +179,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -199,8 +198,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -224,8 +222,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -244,8 +241,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -320,8 +316,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -369,8 +364,7 @@ "name": "executeProposal", "outputs": [], "stateMutability": "payable", - "type": "function", - "payable": true + "type": "function" }, { "inputs": [], @@ -383,8 +377,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -432,7 +425,6 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" } ] \ No newline at end of file diff --git a/src/uma/abi/IdentifierWhitelist.json b/src/uma/abi/IdentifierWhitelist.json index 26071c9..ad78a36 100644 --- a/src/uma/abi/IdentifierWhitelist.json +++ b/src/uma/abi/IdentifierWhitelist.json @@ -55,8 +55,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -121,7 +120,6 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" } ] \ No newline at end of file diff --git a/src/uma/abi/Registry.json b/src/uma/abi/Registry.json index 5c1cdc5..326f6c2 100644 --- a/src/uma/abi/Registry.json +++ b/src/uma/abi/Registry.json @@ -182,8 +182,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -202,8 +201,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -227,8 +225,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -247,8 +244,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -360,8 +356,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -380,8 +375,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -394,8 +388,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -419,7 +412,6 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" } ] \ No newline at end of file diff --git a/src/uma/abi/Store.json b/src/uma/abi/Store.json index 7c658a6..9de376a 100644 --- a/src/uma/abi/Store.json +++ b/src/uma/abi/Store.json @@ -180,8 +180,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -218,8 +217,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -232,8 +230,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -246,8 +243,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -266,8 +262,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -291,8 +286,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -367,8 +361,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -381,8 +374,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -420,8 +412,7 @@ "name": "payOracleFees", "outputs": [], "stateMutability": "payable", - "type": "function", - "payable": true + "type": "function" }, { "inputs": [ @@ -501,8 +492,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -528,8 +518,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/abi/SyntheticToken.json b/src/uma/abi/SyntheticToken.json deleted file mode 100644 index fecbddd..0000000 --- a/src/uma/abi/SyntheticToken.json +++ /dev/null @@ -1,618 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "newMember", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - } - ], - "name": "AddedSharedMember", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldMember", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - } - ], - "name": "RemovedSharedMember", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "newMember", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "manager", - "type": "address" - } - ], - "name": "ResetExclusiveMember", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "newMember", - "type": "address" - } - ], - "name": "addMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - } - ], - "name": "getMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "memberToCheck", - "type": "address" - } - ], - "name": "holdsRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "memberToRemove", - "type": "address" - } - ], - "name": "removeMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - } - ], - "name": "renounceMembership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "roleId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "newMember", - "type": "address" - } - ], - "name": "resetMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addBurner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeBurner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "resetOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isMinter", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isBurner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/src/uma/abi/TestnetERC20.json b/src/uma/abi/TestnetERC20.json deleted file mode 100644 index 692440a..0000000 --- a/src/uma/abi/TestnetERC20.json +++ /dev/null @@ -1,317 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "_decimals", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "allocateTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file diff --git a/src/uma/abi/TokenFactory.json b/src/uma/abi/TokenFactory.json new file mode 100644 index 0000000..eafb797 --- /dev/null +++ b/src/uma/abi/TokenFactory.json @@ -0,0 +1,31 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "tokenSymbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "tokenDecimals", + "type": "uint8" + } + ], + "name": "createToken", + "outputs": [ + { + "internalType": "contract ExpandedIERC20", + "name": "newToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/src/uma/abi/Voting.json b/src/uma/abi/Voting.json index 4fc1675..4de8978 100644 --- a/src/uma/abi/Voting.json +++ b/src/uma/abi/Voting.json @@ -288,8 +288,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -302,8 +301,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -316,8 +314,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -330,8 +327,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -344,8 +340,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -365,8 +360,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -414,8 +408,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -441,8 +434,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -468,8 +460,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -482,8 +473,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -525,8 +515,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -550,8 +539,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -594,8 +582,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -824,8 +811,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -838,8 +824,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -852,8 +837,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/abi/VotingToken.json b/src/uma/abi/VotingToken.json index ca11b8f..1ddb798 100644 --- a/src/uma/abi/VotingToken.json +++ b/src/uma/abi/VotingToken.json @@ -182,8 +182,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -226,8 +225,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -251,8 +249,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -278,8 +275,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -322,8 +318,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -347,8 +342,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -409,8 +403,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -472,8 +465,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -486,8 +478,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -506,8 +497,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/abi/WETH9.json b/src/uma/abi/WETH9.json index 25bce4f..3c32b42 100644 --- a/src/uma/abi/WETH9.json +++ b/src/uma/abi/WETH9.json @@ -89,8 +89,7 @@ }, { "stateMutability": "payable", - "type": "fallback", - "payable": true + "type": "fallback" }, { "inputs": [ @@ -114,8 +113,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ @@ -134,8 +132,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -148,8 +145,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -162,8 +158,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [], @@ -176,21 +171,18 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "stateMutability": "payable", - "type": "receive", - "payable": true + "type": "receive" }, { "inputs": [], "name": "deposit", "outputs": [], "stateMutability": "payable", - "type": "function", - "payable": true + "type": "function" }, { "inputs": [ @@ -216,8 +208,7 @@ } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { "inputs": [ diff --git a/src/uma/contracts.ts b/src/uma/contracts.ts index ee19329..1797e32 100644 --- a/src/uma/contracts.ts +++ b/src/uma/contracts.ts @@ -1,6 +1,5 @@ import addressWhitelistAbi from "./abi/AddressWhitelist.json"; import designatedVotingFactoryAbi from "./abi/DesignatedVotingFactory.json"; -import expiringMultiPartyAbi from "./abi/ExpiringMultiParty.json"; import expiringMultiPartyCreatorAbi from "./abi/ExpiringMultiPartyCreator.json"; import financialContractsAdminAbi from "./abi/FinancialContractsAdmin.json"; import finderAbi from "./abi/Finder.json"; @@ -8,25 +7,27 @@ import governorAbi from "./abi/Governor.json"; import identifierWhitelistAbi from "./abi/IdentifierWhitelist.json"; import registryAbi from "./abi/Registry.json"; import storeAbi from "./abi/Store.json"; -import syntheticTokenAbi from "./abi/SyntheticToken.json"; -import testnetERC20Abi from "./abi/TestnetERC20.json"; import votingAbi from "./abi/Voting.json"; import votingTokenAbi from "./abi/VotingToken.json"; import weth9Abi from "./abi/WETH9.json"; +import tokenFactoryAbi from "./abi/TokenFactory.json"; const contracts = { addressWhitelist: { abi: addressWhitelistAbi, + address: "0x48e687205D3962c43891b8Cde5A4Fe75FA6C8D7a", }, designatedVotingFactory: { abi: designatedVotingFactoryAbi, address: "0xE81EeE5Da165fA6863bBc82dF66E62d18625d592", }, - expiringMultiParty: { - abi: expiringMultiPartyAbi, + expiringMultiPartyLib: { + abi: [], + address: "0x09AFD24Acc170c16f4fF64BDf2A4818C515440e8", }, expiringMultiPartyCreator: { abi: expiringMultiPartyCreatorAbi, + address: "0xdebB91Ab3e473025bb8ce278c02361A3C4f13124", }, financialContractsAdmin: { abi: financialContractsAdminAbi, @@ -52,11 +53,9 @@ const contracts = { abi: storeAbi, address: "0x54f44eA3D2e7aA0ac089c4d8F7C93C27844057BF", }, - syntheticToken: { - abi: syntheticTokenAbi, - }, - testnetERC20: { - abi: testnetERC20Abi, + tokenFactory: { + abi: tokenFactoryAbi, + address: "0x7c96d6235CfaaCcAc5d80fCe74E6032B25dd1F03", }, voting: { abi: votingAbi, diff --git a/tests/kyber.test.ts b/tests/kyber.test.ts index 06ad2a4..33a823b 100644 --- a/tests/kyber.test.ts +++ b/tests/kyber.test.ts @@ -28,8 +28,8 @@ describe("kyber", () => { ); const ethToSwap = 5; - const ethBefore = await wallet.getBalance(); - const daiBefore = await daiContract.balanceOf(wallet.address); + const ethBeforeWei = await wallet.getBalance(); + const daiBeforeWei = await daiContract.balanceOf(wallet.address); const { expectedRate, @@ -40,7 +40,8 @@ describe("kyber", () => { parseEther(`${ethToSwap}`), ); - const expectedDai = expectedRate.mul(bigNumberify(`${ethToSwap}`)); + const expectedDaiWei = expectedRate.mul(bigNumberify(`${ethToSwap}`)); + const expectedDai = parseFloat(fromWei(expectedDaiWei)); // do the actual swapping const minConversionRate = slippageRate; @@ -53,13 +54,14 @@ describe("kyber", () => { }, ); - const ethAfter = await wallet.getBalance(); - const daiAfter = await daiContract.balanceOf(wallet.address); + const ethAfterWei = await wallet.getBalance(); + const daiAfterWei = await daiContract.balanceOf(wallet.address); - const ethLost = parseFloat(fromWei(ethBefore.sub(ethAfter))); + const daiAfter = parseFloat(fromWei(daiAfterWei)); + const ethLost = parseFloat(fromWei(ethBeforeWei.sub(ethAfterWei))); - expect(fromWei(daiBefore)).toBe("0.0"); - expect(fromWei(daiAfter)).toBe(fromWei(expectedDai)); + expect(fromWei(daiBeforeWei)).toBe("0.0"); + expect(daiAfter).toBeCloseTo(expectedDai); expect(ethLost).toBeCloseTo(ethToSwap); }); });