Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSilva committed May 21, 2024
1 parent 66fbaa1 commit 85a2475
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 91 deletions.
33 changes: 33 additions & 0 deletions packages/contracts/script/ForkTest.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import {Script} from "lib/forge-std/src/Script.sol";
import {Sale} from "contracts/token/Sale.sol";

import "forge-std/console.sol";

contract ForkTestScript is Script {
bytes32[] merkleProof = new bytes32[](3);

function run() public {
vm.startBroadcast();

address saleAddr = 0x132D291401f03c743520C8E4429194A885ff1192;
Sale sale = Sale(saleAddr);

console.log(sale.maxTarget());
console.log(sale.minContribution());
console.log(sale.maxTarget() / sale.minContribution());
console.log(sale.paymentTokenToToken(sale.minContribution()));

sale.setMerkleRoot(0xb2a5fa3b3e2f98fd1eec385ca41ee5ec339d6e0e10ef2e628b6dd1c05efd5d2f);

merkleProof[0] = 0x4522f57b6fe79305db47fb076fb0074084084e27b1401a6e2b82e4743ebcd22e;
merkleProof[1] = 0x44a01d943b6e8676e88542b2f512dc51dbd5479373b5317864fd63fbcc0bad32;
merkleProof[2] = 0xfc155ecc3cb89777797847582c94ff6c173964a88c99f2bd13551a83ec921266;

sale.buy(500 ether, merkleProof);

vm.stopBroadcast();
}
}
4 changes: 2 additions & 2 deletions packages/contracts/wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export default defineConfig({
plugins: [
foundry({
project: "./",
exclude: ["MockERC20.sol", "Sale.d.sol", "IERC20.sol"],
exclude: ["MockERC20.sol", "Sale.d.sol", "IERC20.sol", "Deploy.s.sol"],
namePrefix: "Ctznd",
deployments: {
Sale: {
1: "0x85b34Aa54fdf8242e4656eA50b711F45340925bC",
31337: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
11155111: "0x132d291401f03c743520c8e4429194a885ff1192",
11155111: "0x132D291401f03c743520C8E4429194A885ff1192",
},
},
}),
Expand Down
1 change: 1 addition & 0 deletions packages/web-app/app/_lib/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export const useBuyCtzndTokens = () => {

const buyCtzndTokens = useCallback(
(tokensToBuyInWei: bigint) => {
console.log(merkleProof);
if (tokensToBuyInWei === undefined || merkleProof === undefined) {
return;
}
Expand Down
Loading

0 comments on commit 85a2475

Please sign in to comment.