Skip to content

Commit

Permalink
Carbon Batcher - minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzhelyazkov committed Jan 10, 2025
1 parent b180902 commit 6280ced
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
8 changes: 3 additions & 5 deletions contracts/utility/CarbonBatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ contract CarbonBatcher is Upgradeable, Utils, ReentrancyGuard, IERC721Receiver {
*/
event FundsWithdrawn(Token indexed token, address indexed caller, address indexed target, uint256 amount);

constructor(
ICarbonController carbonControllerInit,
IVoucher voucherInit
) validAddress(address(carbonControllerInit)) validAddress(address(voucherInit)) {
_carbonController = carbonControllerInit;
constructor(IVoucher voucherInit) validAddress(address(voucherInit)) {
_voucher = voucherInit;
_carbonController = ICarbonController(_voucher.controller());

_disableInitializers();
}
Expand Down Expand Up @@ -127,6 +124,7 @@ contract CarbonBatcher is Upgradeable, Utils, ReentrancyGuard, IERC721Receiver {

/**
* @notice withdraws funds held by the contract and sends them to an account
* @notice note that this is a safety mechanism, shouldn't be necessary in normal operation
*
* requirements:
*
Expand Down
3 changes: 1 addition & 2 deletions deploy/scripts/mainnet/0018-CarbonBatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types';
const func: DeployFunction = async ({ getNamedAccounts }: HardhatRuntimeEnvironment) => {
const { deployer } = await getNamedAccounts();

const carbonController = await DeployedContracts.CarbonController.deployed();
const voucher = await DeployedContracts.Voucher.deployed();

await deployProxy({
name: InstanceName.CarbonBatcher,
from: deployer,
args: [carbonController.address, voucher.address]
args: [voucher.address]
});

return true;
Expand Down
2 changes: 1 addition & 1 deletion test/forge/CarbonBatcher.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract CarbonBatcherTest is TestFixture {
// Deploy Carbon Controller and Voucher
setupCarbonController();
// Deploy Carbon Batcher
deployCarbonBatcher(carbonController, voucher);
deployCarbonBatcher(voucher);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/forge/TestFixture.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ contract TestFixture is Test {
/**
* @dev deploys carbon batch strategies
*/
function deployCarbonBatcher(TestCarbonController _carbonController, TestVoucher _voucher) internal {
function deployCarbonBatcher(TestVoucher _voucher) internal {
// deploy contracts from admin
vm.startPrank(admin);

// Deploy Carbon Batch Strategies
carbonBatcher = new CarbonBatcher(ICarbonController(address(_carbonController)), IVoucher(address(_voucher)));
carbonBatcher = new CarbonBatcher(IVoucher(address(_voucher)));

bytes memory initData = abi.encodeWithSelector(carbonBatcher.initialize.selector);
// Deploy Carbon Batcher proxy
Expand Down

0 comments on commit 6280ced

Please sign in to comment.