generated from BreadchainCoop/solidity-foundry-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: combined hackathon contracts, applied functional programmin…
…g paradigm, natspec
- Loading branch information
Showing
18 changed files
with
2,001 additions
and
631 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
forge-std/=node_modules/forge-std/src | ||
halmos-cheatcodes=node_modules/halmos-cheatcodes | ||
|
||
@openzeppelin/=node_modules/@openzeppelin/contracts/ | ||
@openzeppelin-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ | ||
@oz/=node_modules/@openzeppelin/contracts/ | ||
@oz-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ | ||
@builders-dollar-token/=node_modules/BuildersDollarToken/src/ | ||
@eas/=node_modules/@ethereum-attestation-service/eas-contracts/contracts | ||
|
||
contracts/=src/contracts | ||
interfaces/=src/interfaces |
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,40 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
import {IERC20} from '@openzeppelin/token/ERC20/IERC20.sol'; | ||
import {Greeter, IGreeter} from 'contracts/Greeter.sol'; | ||
// import {IERC20} from '@oz/token/ERC20/IERC20.sol'; | ||
import {IBuildersManager} from 'contracts/BuildersManager.sol'; | ||
import {Script} from 'forge-std/Script.sol'; | ||
// solhint-disable-next-line | ||
import 'script/Registry.sol'; | ||
|
||
/** | ||
* @title Common Contract | ||
* @author Breadchain | ||
* @notice This contract is used to deploy the Greeter contract | ||
* @notice This contract is used to deploy the BuildersManager contract | ||
* @dev This contract is intended for use in Scripts and Integration Tests | ||
*/ | ||
contract Common is Script { | ||
struct DeploymentParams { | ||
string greeting; | ||
IERC20 token; | ||
} | ||
|
||
IGreeter public greeter; | ||
IBuildersManager public builderManager; | ||
|
||
/// @notice Deployment parameters for each chain | ||
mapping(uint256 _chainId => DeploymentParams _params) internal _deploymentParams; | ||
// mapping(uint256 _chainId => DeploymentParams _params) internal _deploymentParams; | ||
|
||
function setUp() public virtual { | ||
// Optimism | ||
_deploymentParams[10] = DeploymentParams('Hello, Optimism!', IERC20(OPTIMISM_DAI)); | ||
|
||
// Gnosis | ||
_deploymentParams[100] = DeploymentParams('Hello, Gnosis!', IERC20(GNOSIS_BREAD)); | ||
// _deploymentParams[10] = DeploymentParams('Hello, Optimism!', IERC20(OPTIMISM_DAI)); | ||
} | ||
|
||
function _deployContracts() internal { | ||
DeploymentParams memory _params = _deploymentParams[block.chainid]; | ||
// DeploymentParams memory _params = _deploymentParams[block.chainid]; | ||
|
||
greeter = new Greeter(_params.greeting, _params.token); | ||
// builderManager = new BuildersManager(_params.greeting, _params.token); | ||
} | ||
} |
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,17 +1,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
/// @dev Example of addresses that may be stored in the Registry for use throughout the repository | ||
|
||
// Tokens (Optimism Chain) | ||
address constant OPTIMISM_DAI = 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1; | ||
|
||
// Tokens (Gnosis Chain) | ||
address constant GNOSIS_BREAD = 0xa555d5344f6FB6c65da19e403Cb4c1eC4a1a5Ee3; | ||
address constant GNOSIS_XDAI = 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d; | ||
|
||
// Curve Factory (Gnosis Chain) | ||
address constant GNOSIS_CURVE_STABLE_SWAP_FACTORY = 0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8; | ||
|
||
// Liquidity Pools (Gnosis Chain) | ||
address constant GNOSIS_CURVE_POOL_XDAI_BREAD = 0xf3D8F3dE71657D342db60dd714c8a2aE37Eac6B4; |
Oops, something went wrong.