Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wUSDM as collateral to USDT market on Optimism #945

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/deploy-market.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }}
Expand All @@ -48,7 +48,7 @@ jobs:
with:
wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
requested_network: "${{ inputs.network }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
port: 8585
if: github.event.inputs.eth_pk == ''

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/enact-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }}
Expand All @@ -76,7 +76,7 @@ jobs:
with:
wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
requested_network: "${{ inputs.network }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
port: 8585
if: github.event.inputs.eth_pk == ''

Expand All @@ -85,7 +85,7 @@ jobs:
with:
wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
requested_network: "${{ env.GOV_NETWORK }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}"
port: 8685
if: github.event.inputs.eth_pk == '' && env.GOV_NETWORK != ''

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }}
Expand All @@ -48,7 +48,7 @@ jobs:
with:
wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
requested_network: "${{ inputs.network }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}"
port: 8585
if: github.event.inputs.eth_pk == ''

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-contract-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-eslint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-gas-profiler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-semgrep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }}
container:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ANKR_KEY: ${{ secrets.ANKR_KEY }}
POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }}
ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }}
LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }}
Expand Down
79 changes: 79 additions & 0 deletions contracts/IERC20.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.15;

/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);

/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);

/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);

/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);

/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);

/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);

/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);

/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
26 changes: 26 additions & 0 deletions contracts/IERC20Metadata.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.15;

import {IERC20} from "./IERC20.sol";

/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);

/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);

/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
Loading