MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / addOracles

Function addOracles

test/helpers/createInstances.js:174–184  ·  view source on GitHub ↗
(account_polymath)

Source from the content-addressed store, hash-verified

172}
173
174export async function addOracles(account_polymath) {
175 let USDETH = new BN(500).mul(new BN(10).pow(new BN(18))); // 500 USD/ETH
176 let USDPOLY = new BN(25).mul(new BN(10).pow(new BN(16))); // 0.25 USD/POLY
177 let StableChange = new BN(10).mul(new BN(10).pow(new BN(16))); // 0.25 USD/POLY
178 I_USDOracle = await MockOracle.new("0x0000000000000000000000000000000000000000", web3.utils.fromAscii("ETH"), web3.utils.fromAscii("USD"), USDETH, { from: account_polymath }); // 500 dollars per POLY
179 I_POLYOracle = await MockOracle.new(I_PolyToken.address, web3.utils.fromAscii("POLY"), web3.utils.fromAscii("USD"), USDPOLY, { from: account_polymath }); // 25 cents per POLY
180 I_StablePOLYOracle = await StableOracle.new(I_POLYOracle.address, StableChange, { from: account_polymath });
181 await I_PolymathRegistry.changeAddress("EthUsdOracle", I_USDOracle.address, { from: account_polymath });
182 await I_PolymathRegistry.changeAddress("PolyUsdOracle", I_POLYOracle.address, { from: account_polymath });
183 await I_PolymathRegistry.changeAddress("StablePolyUsdOracle", I_StablePOLYOracle.address, { from: account_polymath });
184}
185
186export async function deployPolyRegistryAndPolyToken(account_polymath, token_owner) {
187 // Step 0: Deploy the PolymathRegistry

Callers 1

setUpPolymathNetworkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected