Skip to content

Commit

Permalink
Fix formatting, set numerator back to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
AllFi committed Jun 6, 2024
1 parent 7c8d9f5 commit 6c43007
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 115 deletions.
85 changes: 0 additions & 85 deletions script/scripts/DeployZkBobPoolModules.s.sol

This file was deleted.

7 changes: 1 addition & 6 deletions script/scripts/Local.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ contract DeployLocal is Script {
EIP1967Proxy queueProxy = new EIP1967Proxy(tx.origin, mockImpl, "");

ZkBobPoolBOB poolImpl = new ZkBobPoolBOB(
zkBobPoolId,
address(bob),
transferVerifier,
treeVerifier,
batchDepositVerifier,
address(queueProxy)
zkBobPoolId, address(bob), transferVerifier, treeVerifier, batchDepositVerifier, address(queueProxy)
);
{
bytes memory initData = abi.encodeWithSelector(ZkBobPool.initialize.selector, zkBobInitialRoot);
Expand Down
5 changes: 4 additions & 1 deletion script/scripts/MigrateAccounting.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ contract UpgradeTest is Test {
}
}

/**
* @dev Don't forget to set ZkBobPool.TOKEN_NUMERATOR to 1000 for USDC pools.
*/
contract MigrateAccounting is Script, UpgradeTest {
function run() external {
ZkBobPoolUSDC pool = ZkBobPoolUSDC(address(zkBobPool));
Expand Down Expand Up @@ -164,4 +167,4 @@ contract MigrateAccounting is Script, UpgradeTest {
res := shr(sub(256, shl(3, _len)), mload(add(_dump, add(32, _from))))
}
}
}
}
28 changes: 16 additions & 12 deletions script/scripts/ZkBobPool.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,31 @@ contract DeployZkBobPool is Script {

if (zkBobPoolType == PoolType.ETH) {
vars.poolImpl = new ZkBobPoolETH(
zkBobPoolId, zkBobToken,
transferVerifier, treeVerifier, batchDepositVerifier,
address(vars.queueProxy), permit2
zkBobPoolId,
zkBobToken,
transferVerifier,
treeVerifier,
batchDepositVerifier,
address(vars.queueProxy),
permit2
);
} else if (zkBobPoolType == PoolType.BOB) {
vars.poolImpl = new ZkBobPoolBOB(
zkBobPoolId, zkBobToken,
transferVerifier, treeVerifier, batchDepositVerifier,
address(vars.queueProxy)
zkBobPoolId, zkBobToken, transferVerifier, treeVerifier, batchDepositVerifier, address(vars.queueProxy)
);
} else if (zkBobPoolType == PoolType.USDC) {
vars.poolImpl = new ZkBobPoolUSDC(
zkBobPoolId, zkBobToken,
transferVerifier, treeVerifier, batchDepositVerifier,
address(vars.queueProxy)
zkBobPoolId, zkBobToken, transferVerifier, treeVerifier, batchDepositVerifier, address(vars.queueProxy)
);
} else if (zkBobPoolType == PoolType.ERC20) {
vars.poolImpl = new ZkBobPoolERC20(
zkBobPoolId, zkBobToken,
transferVerifier, treeVerifier, batchDepositVerifier,
address(vars.queueProxy), permit2,
zkBobPoolId,
zkBobToken,
transferVerifier,
treeVerifier,
batchDepositVerifier,
address(vars.queueProxy),
permit2,
vars.denominator
);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IZkBobDirectDeposits.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface IZkBobDirectDeposits {
Pending, // requested deposit was submitted and is pending in the queue
Completed, // requested deposit was successfully processed
Refunded // requested deposit was refunded to the fallback receiver

}

struct DirectDeposit {
Expand Down
2 changes: 1 addition & 1 deletion src/zkbob/ZkBobPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract contract ZkBobPool is IZkBobPool, EIP1967Admin, Ownable, Parameters, Ex
uint256 internal constant FORCED_EXIT_MAX_DELAY = 24 hours;

uint256 internal immutable TOKEN_DENOMINATOR;
uint256 internal constant TOKEN_NUMERATOR = 1000;
uint256 internal constant TOKEN_NUMERATOR = 1;

uint256 public immutable pool_id;
ITransferVerifier public immutable transfer_verifier;
Expand Down
35 changes: 25 additions & 10 deletions test/zkbob/ZkBobPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,42 @@ abstract contract AbstractZkBobPoolTest is AbstractForkTest {
ZkBobPool impl;
if (poolType == PoolType.ETH) {
impl = new ZkBobPoolETH(
0, token,
new TransferVerifierMock(), new TreeUpdateVerifierMock(), new BatchDepositVerifierMock(),
address(queueProxy), permit2
0,
token,
new TransferVerifierMock(),
new TreeUpdateVerifierMock(),
new BatchDepositVerifierMock(),
address(queueProxy),
permit2
);
} else if (poolType == PoolType.BOB) {
impl = new ZkBobPoolBOB(
0, token,
new TransferVerifierMock(), new TreeUpdateVerifierMock(), new BatchDepositVerifierMock(),
0,
token,
new TransferVerifierMock(),
new TreeUpdateVerifierMock(),
new BatchDepositVerifierMock(),
address(queueProxy)
);
} else if (poolType == PoolType.USDC) {
impl = new ZkBobPoolUSDC(
0, token,
new TransferVerifierMock(), new TreeUpdateVerifierMock(), new BatchDepositVerifierMock(),
0,
token,
new TransferVerifierMock(),
new TreeUpdateVerifierMock(),
new BatchDepositVerifierMock(),
address(queueProxy)
);
} else if (poolType == PoolType.ERC20) {
impl = new ZkBobPoolERC20(
0, token,
new TransferVerifierMock(), new TreeUpdateVerifierMock(), new BatchDepositVerifierMock(),
address(queueProxy), permit2, 1_000_000_000
0,
token,
new TransferVerifierMock(),
new TreeUpdateVerifierMock(),
new BatchDepositVerifierMock(),
address(queueProxy),
permit2,
1_000_000_000
);
}

Expand Down

0 comments on commit 6c43007

Please sign in to comment.