Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jjranalli committed Jan 10, 2023
1 parent 26026ba commit 1d8f6de
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 31 deletions.
21 changes: 17 additions & 4 deletions .example.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
RINKEBY_RPC_PROVIDER_URL=
MAINNET_RPC_PROVIDER_URL=
SENDER_ADDRESS=
ETHERSCAN_API_KEY=
# RPC urls
RPC_URL_MAINNET=https://eth-mainnet.alchemyapi.io/v2/{YOUR_API_KEY}
RPC_URL_GOERLI=https://eth-goerli.g.alchemy.com/v2/{YOUR_API_KEY}
# RPC_URL_ARBITRUM=
# RPC_URL_OPTIMISM=
# RPC_URL_POLYGON=
# RPC_URL_AVALANCHE=
# RPC_URL_FANTOM=

# API key to verify contract on etherscan
ETHERSCAN_API_KEY=

# Deployer account
PRIVATE_KEY=

# Used for CREATE3 deployment script
SALT=
2 changes: 1 addition & 1 deletion contracts/BluntDelegateCloner.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import '@openzeppelin/proxy/Clones.sol';
import '@openzeppelin/contracts/proxy/Clones.sol';
import './BluntDelegateClone.sol';
import './interfaces/IBluntDelegateCloner.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/BluntDelegateProjectDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.17;
import '@jbx-protocol/juice-contracts-v3/contracts/abstract/JBOperatable.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/libraries/JBOperations.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/libraries/JBConstants.sol';
import '@openzeppelin/access/Ownable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import './interfaces/IBluntDelegateProjectDeployer.sol';

contract BluntDelegateProjectDeployer is IBluntDelegateProjectDeployer, JBOperatable, Ownable {
Expand Down
6 changes: 3 additions & 3 deletions contracts/interfaces/IBluntDelegate.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import '@openzeppelin/token/ERC20/IERC20.sol';
import '@openzeppelin/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/token/ERC1155/IERC1155Receiver.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBFundingCycleDataSource.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBController.sol';
import '../structs/DeployBluntDelegateDeployerData.sol';
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/ISliceCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.0;

import './ISlicer.sol';
import './ISlicerManager.sol';
import '@openzeppelin/interfaces/IERC1155.sol';
import '@openzeppelin/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/interfaces/IERC1155.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';

interface ISliceCore is IERC1155, IERC2981 {
function slicerManager() external view returns (ISlicerManager slicerManagerAddress);
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/ISlicer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.0;

import '../structs/DepositAmount.sol';
import '../structs/AccountAmount.sol';
import '@openzeppelin/token/ERC1155/IERC1155Receiver.sol';
import '@openzeppelin/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';

interface ISlicer is IERC721Receiver, IERC1155Receiver {
function release(address account, address currency, bool withdraw) external;
Expand Down
13 changes: 3 additions & 10 deletions deployments.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"1": {
"BluntDelegateDeployer": "",
"BluntDelegateCloner": "",
"BluntDelegateProjectDeployer": ""
},
"5": {
"BluntDelegateDeployer": "0xe179d0043b627130C0917107E62A0862b6DF3bf6",
"BluntDelegateCloner": "0x460996e8dDdaBE35eA48278111eD18202F4F1Fc7",
"BluntDelegateProjectDeployer": "0xA20294B04C9dE0dA8Ca83E5779b356462d2f0a65"
}
"BluntDelegateDeployer": "0xe179d0043b627130C0917107E62A0862b6DF3bf6",
"BluntDelegateCloner": "0x460996e8dDdaBE35eA48278111eD18202F4F1Fc7",
"BluntDelegateProjectDeployer": "0xA20294B04C9dE0dA8Ca83E5779b356462d2f0a65"
}
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ solmate/=lib/solmate/src/
create3-factory=lib/create3-factory/src/
@jbx-protocol/juice-contracts-v3=lib/juice-contracts-v3
@prb/math=lib/prb-math/
@openzeppelin=lib/openzeppelin-contracts/contracts
@openzeppelin/contracts=lib/openzeppelin-contracts/contracts
@openzeppelin-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts
8 changes: 7 additions & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contract DeployScript is Script {
// GOERLI
IJBController jbController = IJBController(0x7Cb86D43B665196BC719b6974D320bf674AFb395);
IJBOperatorStore jbOperatorStore = IJBOperatorStore(0x99dB6b517683237dE9C494bbd17861f3608F3585);
uint256 bluntProjectId; // TODO:
address ethAddress = 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6;
address usdcAddress = 0x2f3A40A3db8a7e3D09B0adfEfbCe4f6F81927557;

Expand All @@ -39,8 +40,13 @@ contract DeployScript is Script {
delegateCloner,
jbController,
jbOperatorStore,
bluntProjectId,
ethAddress,
usdcAddress
usdcAddress,
350, // maxK, 3.5%
150, // minK, 1.5%
2e13, // upperFundraiseBoundary, $20M
1e11 // lowerFundraiseBoundary, $100k
)
)
)
Expand Down
4 changes: 2 additions & 2 deletions test/BluntDelegate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ contract BluntDelegateTest is BluntSetup {
bluntDelegateAlt_.closeRound();

uint256 bluntFee = _calculateFee(totalContributions);
assertEq(bluntFee, (totalContributions * 500) / 10000);
assertEq(bluntFee, (totalContributions * _maxK) / 10000);
}

function testCalculateFee_midBoundary() public {
Expand Down Expand Up @@ -813,7 +813,7 @@ contract BluntDelegateTest is BluntSetup {
bluntDelegateAlt_.closeRound();

uint256 bluntFee = _calculateFee(totalContributions);
assertEq(bluntFee, (totalContributions * 150) / 10000);
assertEq(bluntFee, (totalContributions * _minK) / 10000);
}

function testCalculateFee_linearDecrement(uint256 amount) public {
Expand Down
6 changes: 2 additions & 4 deletions test/helper/BluntSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import '@jbx-protocol/juice-contracts-v3/contracts/interfaces/IJBToken.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/libraries/JBOperations.sol';
import '@jbx-protocol/juice-contracts-v3/contracts/libraries/JBFundingCycleMetadataResolver.sol';

import '@paulrberg/contracts/math/PRBMath.sol';

import {DSTestPlus} from 'solmate/test/utils/DSTestPlus.sol';
import 'forge-std/console2.sol';

Expand Down Expand Up @@ -74,9 +72,9 @@ contract BluntSetup is DSTestPlus {
bool internal _isTargetUsd = false;
bool internal _isHardcapUsd = false;
bool internal _clone = false;
uint256 internal _maxK = 500;
uint256 internal _maxK = 350;
uint256 internal _minK = 150;
uint256 internal _upperFundraiseBoundary = 1e13;
uint256 internal _upperFundraiseBoundary = 2e13;
uint256 internal _lowerFundraiseBoundary = 1e11;

address internal _bluntProjectOwner = address(bytes20(keccak256('bluntProjectOwner')));
Expand Down

0 comments on commit 1d8f6de

Please sign in to comment.