-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement IOracle to SortedOracles & add FeeCurrencyDirectory to devc…
…hain (#10993) * FeeCurrencyDirectory to devchain * Mento Fee Currency adapter * MentoFeeCurrencyAdapter test * lint * Update of SortedOracles * tests added * fix test release * lint * removal of MentoFeeCurrencyAdapterV1
- Loading branch information
Showing
11 changed files
with
131 additions
and
41 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
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
6 changes: 6 additions & 0 deletions
6
packages/protocol/contracts/common/proxies/FeeCurrencyDirectoryProxy.sol
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,6 @@ | ||
pragma solidity ^0.5.13; | ||
|
||
import "../Proxy.sol"; | ||
|
||
/* solhint-disable-next-line no-empty-blocks */ | ||
contract FeeCurrencyDirectoryProxy is Proxy {} |
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
52 changes: 52 additions & 0 deletions
52
packages/protocol/migrations_ts/26_100_fee_currency_directory.ts
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,52 @@ | ||
import { ArtifactsSingleton } from '@celo/protocol/lib/artifactsSingleton' | ||
import { CeloContractName } from '@celo/protocol/lib/registry-utils' | ||
import { | ||
deploymentForCoreContract, | ||
getDeployedProxiedContract, | ||
} from '@celo/protocol/lib/web3-utils' | ||
import { SortedOraclesInstance, StableTokenInstance } from '@celo/protocol/types/typechain-mento' | ||
import { FeeCurrencyDirectoryInstance } from 'types/08' | ||
import { MENTO_PACKAGE, SOLIDITY_08_PACKAGE } from '../contractPackages' | ||
|
||
const initializeArgs = async (): Promise<any[]> => { | ||
return [] | ||
} | ||
|
||
module.exports = deploymentForCoreContract<FeeCurrencyDirectoryInstance>( | ||
web3, | ||
artifacts, | ||
CeloContractName.FeeCurrencyDirectory, | ||
initializeArgs, | ||
async (feeCurrencyDirectory: FeeCurrencyDirectoryInstance, _web3: Web3, networkName: string) => { | ||
const sortedOracles = await getDeployedProxiedContract<SortedOraclesInstance>( | ||
'SortedOracles', | ||
artifacts | ||
) | ||
|
||
for (const token of ['StableToken', 'StableTokenEUR', 'StableTokenBRL']) { | ||
const stableToken: StableTokenInstance = | ||
await getDeployedProxiedContract<StableTokenInstance>( | ||
token, | ||
ArtifactsSingleton.getInstance(MENTO_PACKAGE) | ||
) | ||
console.log( | ||
'setting currency config for', | ||
token, | ||
'with address', | ||
stableToken.address, | ||
'and adapter address', | ||
sortedOracles.address, | ||
'on network', | ||
networkName | ||
) | ||
await feeCurrencyDirectory.setCurrencyConfig(stableToken.address, sortedOracles.address, 1) | ||
} | ||
|
||
console.log( | ||
'Fee currency directory deployed and registered!!!', | ||
feeCurrencyDirectory.address, | ||
networkName | ||
) | ||
}, | ||
SOLIDITY_08_PACKAGE | ||
) |
3 changes: 3 additions & 0 deletions
3
packages/protocol/releaseData/initializationData/release12.json
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,3 @@ | ||
{ | ||
"FeeCurrencyDirectory": [] | ||
} |
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.