Skip to content

Commit

Permalink
refactor: combined hackathon contracts, applied functional programmin…
Browse files Browse the repository at this point in the history
…g paradigm, natspec
  • Loading branch information
daopunk committed Nov 25, 2024
1 parent 858cda0 commit feb7d27
Show file tree
Hide file tree
Showing 18 changed files with 2,001 additions and 631 deletions.
225 changes: 0 additions & 225 deletions README.md

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
"package.json": "sort-package-json"
},
"dependencies": {
"@ethereum-attestation-service/eas-contracts": "ethereum-attestation-service/eas-contracts",
"@openzeppelin/contracts": "^5.1.0",
"@openzeppelin/contracts-upgradeable": "^5.1.0"
"@openzeppelin/contracts-upgradeable": "^5.1.0",
"BuildersDollarToken": "BreadchainCoop/BuildersDollarToken"
},
"devDependencies": {
"@commitlint/cli": "19.3.0",
Expand Down
6 changes: 4 additions & 2 deletions remappings.txt
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
24 changes: 8 additions & 16 deletions script/Common.sol
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);
}
}
12 changes: 0 additions & 12 deletions script/Registry.sol
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;
Loading

0 comments on commit feb7d27

Please sign in to comment.