-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
7704a9b chore: reserve storage gap in new contracts 040b7fe GoodDollar Fork Tests (#530) 2ee14b4 Feat(454): Exchange provider tests (#529) 578747c test: add BancorExchangeProvider pricing tests (#532) fcd3d02 feat: improve tests around the expansion controller (#533) d3a31fa Streamline comments and errors (#528) ec64f0a fix: ☦ pray to the lords of echidna 13d3a98 fix: add back forge install to the CI step c236009 fix: echidna tests c50a198 feat: add Broker liquidity check (#523) 914ba7d Address Slither Issues in GoodDollar/Bancor Contracts (#526) 8bcf3fd Feat/change gdollar modifiers (#524) 379a511 feat: make validate() internal bcbd9aa chore: added "yarn todo" task to log out open todos in the code 0631c60 refactor: renamed SafeERC20 to SafeERC20MintableBurnable 2800297 feat: simplified SafeERC20 e858391 feat: extend open zeppelin's IERC20 instead of duplicating it 196f6be chore: fixed linter and compiler warnings 096efe2 test: fix fork integration test e5308d9 feat: add GoodDollar contracts + tests 3135626 feat: update Broker + TradingLimits to 0.8 and make G$ changes
- Loading branch information
Showing
48 changed files
with
6,799 additions
and
402 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
CELOSCAN_API_KEY= | ||
CELO_MAINNET_RPC_URL=https://forno.celo.org | ||
BAKLAVA_RPC_URL=https://baklava-forno.celo-testnet.org | ||
ALFAJORES_RPC_URL=https://alfajores-forno.celo-testnet.org | ||
ALFAJORES_RPC_URL=https://alfajores-forno.celo-testnet.org |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,59 @@ | ||
name: "CI" | ||
name: CI | ||
|
||
env: | ||
FOUNDRY_PROFILE: "ci" | ||
FOUNDRY_PROFILE: ci | ||
ALFAJORES_RPC_URL: ${{secrets.ALFAJORES_RPC_URL}} | ||
CELO_MAINNET_RPC_URL: ${{secrets.CELO_MAINNET_RPC_URL}} | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
- "develop" | ||
- main | ||
- develop | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
lint_and_test: | ||
name: Lint & Test | ||
runs-on: "ubuntu-latest" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v3" | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: "Install Node.js" | ||
uses: "actions/setup-node@v3" | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: "yarn" | ||
cache: yarn | ||
node-version: "20" | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "yarn install --immutable" | ||
- name: Install the Node.js dependencies | ||
run: yarn install --immutable | ||
|
||
- name: "Lint the contracts" | ||
run: "yarn lint" | ||
- name: Lint the contracts | ||
run: yarn lint | ||
|
||
- name: "Add lint summary" | ||
- name: Add lint summary | ||
run: | | ||
echo "## Lint" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: "Show the Foundry config" | ||
run: "forge config" | ||
- name: Show the Foundry config | ||
run: forge config | ||
|
||
- name: "Run the tests" | ||
run: "forge test" | ||
- name: Run the tests | ||
run: forge test | ||
|
||
- name: "Check contract sizes" | ||
run: "yarn run check-contract-sizes" | ||
- name: Check contract sizes | ||
run: yarn run check-contract-sizes | ||
|
||
- name: "Add test summary" | ||
- name: Add test summary | ||
run: | | ||
echo "## Tests" >> $GITHUB_STEP_SUMMARY |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint | ||
yarn todo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
import "openzeppelin-contracts-next/contracts/token/ERC20/IERC20.sol"; | ||
|
||
/** | ||
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include | ||
* the optional functions; to access them see {ERC20Detailed}. | ||
*/ | ||
interface IERC20MintableBurnable is IERC20 { | ||
function mint(address account, uint256 amount) external; | ||
function burn(uint256 amount) external; | ||
} |
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,47 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
import { IERC20MintableBurnable as IERC20 } from "contracts/common/IERC20MintableBurnable.sol"; | ||
import { Address } from "openzeppelin-contracts-next/contracts/utils/Address.sol"; | ||
|
||
/** | ||
* @title SafeERC20MintableBurnable | ||
* @dev Wrappers around ERC20 operations that throw on failure (when the token | ||
* contract returns false). Tokens that return no value (and instead revert or | ||
* throw on failure) are also supported, non-reverting calls are assumed to be | ||
* successful. | ||
* To use this library you can add a `using SafeERC20MintableBurnable for IERC20;` statement to your contract, | ||
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc. | ||
*/ | ||
library SafeERC20MintableBurnable { | ||
using Address for address; | ||
|
||
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { | ||
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); | ||
} | ||
|
||
function safeMint(IERC20 token, address account, uint256 amount) internal { | ||
_callOptionalReturn(token, abi.encodeWithSelector(token.mint.selector, account, amount)); | ||
} | ||
|
||
function safeBurn(IERC20 token, uint256 amount) internal { | ||
_callOptionalReturn(token, abi.encodeWithSelector(token.burn.selector, amount)); | ||
} | ||
|
||
/** | ||
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement | ||
* on the return value: the return value is optional (but if data is returned, it must not be false). | ||
* @param token The token targeted by the call. | ||
* @param data The call data (encoded using abi.encode or one of its variants). | ||
*/ | ||
function _callOptionalReturn(IERC20 token, bytes memory data) private { | ||
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since | ||
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that | ||
// the target address contains contract code and also asserts for success in the low-level call. | ||
|
||
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); | ||
if (returndata.length > 0) { | ||
// Return data is optional | ||
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); | ||
} | ||
} | ||
} |
Oops, something went wrong.