Skip to content

Commit

Permalink
Merge pull request #11 from fksyuan/feature/exchange-volume-hooks
Browse files Browse the repository at this point in the history
update readme and call AttestationRegistry script
  • Loading branch information
xudean authored Jan 20, 2025
2 parents 02dd6aa + b4d4305 commit 73c5d34
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .env.bsc-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ TOKEN1=

CL_HOOK=
BIN_HOOK=

FEE_RECIPIENT=0x95DE54300C06E11f348874f30c5c66F5787437d2
PRIMUS_ZKTLS=0x6F6120c4A784641D882306900945877cdce726A0
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ The [AttestationRegistry](src/attestation/AttestationRegistry.sol) contract is u



## BaseFeeDiscountHook
## CLExchangeVolumeHook

The [BaseFeeDiscountHook](src/pool-cl/volume/CLBaseFeeDiscountHook.solk.sol) implements the `beforeAddLiquidity` and `beforeSwap` hooks.
The [CLExchangeVolumeHook](src/pool-cl/volume/CLExchangeVolumeHook.sol) implements the `afterInitialize` and `beforeSwap` hooks.

[BaseFeeDiscountHook Contract](./docs/src/src/BaseFeeDiscountHook.sol/contract.BaseFeeDiscountHook.md)
[CLExchangeVolumeHook Contract](./docs/src/src/pool-cl/volume/CLExchangeVolumeHook.sol/contract.CLExchangeVolumeHook.md)

## CLBaseHook
## BinExchangeVolumeHook

The [CLBaseHook](src/pool-cl/volume/CLBaseHook.solk.sol) implements the `beforeAddLiquidity` and `beforeSwap` hooks.
The [BinExchangeVolumeHook](src/pool-bin/volume/BinExchangeVolumeHook.sol) implements the `afterInitialize` and `beforeSwap` hooks.

[CLBaseHook Contract](./docs/src/src/CLBaseHook.sol/contract.CLBaseHook.md)
[BinExchangeVolumeHook Contract](./docs/src/src/pool-bin/volume/BinExchangeVolumeHook.sol/contract.BinExchangeVolumeHook.md)

## BSC-Testnet

### Configurations

1. Copy `./.env.bsc-testnet` to `./.env`, and set your private key (`PRIVATE_KEY`).
2. The following parameters are already set:
- Pancake Swap ([Vault](https://testnet.bscscan.com/address/0x08F012b8E2f3021db8bd2A896A7F422F4041F131), [CLPoolManager](https://testnet.bscscan.com/address/0x969D90aC74A1a5228b66440f8C8326a8dA47A5F9), [CLPositionManager](https://testnet.bscscan.com/address/0x89A7D45D007077485CB5aE2abFB740b1fe4FF574), [UniversalRouter](https://testnet.bscscan.com/address/0x30067B296Edf5BEbB1CB7b593898794DDF6ab7c5)).
- The arguments of Hook ([EAS](https://testnet.bscscan.com/address/0x6c2270298b1e6046898a322acB3Cbad6F99f7CBD), [EASProxy](https://testnet.bscscan.com/address/0x620e84546d71A775A82491e1e527292e94a7165A), [SchemaBytes](https://testnet.bascan.io/schema/0x5f868b117fd34565f3626396ba91ef0c9a607a0e406972655c5137c6d4291af9)).
- Pancake Swap ([Vault](https://testnet.bscscan.com/address/0xd557753bde3f0EaF32626F8681Ac6d8c1EBA2BBa), [CLPoolManager](https://testnet.bscscan.com/address/0x70890E308DCE727180ac1B9550928fED342dea52), [CLPositionManager](https://testnet.bscscan.com/address/0x7E7856fBE18cd868dc9E2C161a7a78c53074D106), [UniversalRouter](https://testnet.bscscan.com/address/0x1c3112A0A62563F02D44659E6340409E02B6c02f)).
- The arguments of Hook ([AttestationRegistry](https://testnet.bscscan.com/address/0x9109Ea5A8Af5c3c5600F6E8213bd83348C81a573)).


### Deployment
Expand Down
19 changes: 19 additions & 0 deletions script/attestation/CallAttestationRegistry.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import { Script } from "forge-std/Script.sol";
import {AttestationRegistry} from "src/attestation/AttestationRegistry.sol";

contract CallAttestationRegistry is Script {
function run() public {
uint256 senderPrivateKey = vm.envUint("PRIVATE_KEY");
address attestationRegistryAddr = vm.envAddress("ATTESTATION_REGISTRY");
address primusAddr = vm.envAddress("PRIMUS_ZKTLS");
vm.startBroadcast(senderPrivateKey);

AttestationRegistry attReg = AttestationRegistry(address(attestationRegistryAddr));
attReg.setPrimusZKTLS(primusAddr);

vm.stopBroadcast();
}
}

0 comments on commit 73c5d34

Please sign in to comment.