-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
SablierMerkleInstant
(#999)
* feat: add SablierMerkleInstant refactor: abstract contract SablierMerkleLockup to SablierMerkleBase refactor: library MerkleLockup to MerkleBase refactor: contract MerkleLockupFactory to MerkleFactory test: add test for MerkleInstant contract chore: add CreateMerkleInstant script test: use super.setUp() where setUp() is redundant test: rename merkle-lockup folder to merkle test: rename MerkleLockup_Integration_Test contract to Merkle_Shared_Integration_Test test: fix event assersion in merkleLL and merkleLT refactor: rename MerkleLockup to Merkle Lockup in NatSpecs Co-authored-by: Andrei Vlad Birgaoanu <99738872+andreivladbrg@users.noreply.github.com> * test: include asset transfer log in merkle instant claims * test(refactor): rename Merkle_Shared_Integration_Test back to Merkle_Integration_Test * test: refactor merkle-lockup folder to merkle-campaign Signed-off-by: smol-ninja <shubhamy2015@gmail.com> * refactor: polish code for createMerkleLL and createMerkleLT scripts refactor: rename DeployMerkleLockupFactory to DeployMerkleFactory Co-authored-by: Andrei Vlad Birgaoanu <99738872+andreivladbrg@users.noreply.github.com> * test(fork): remove unneeded vars --------- Signed-off-by: smol-ninja <shubhamy2015@gmail.com> Co-authored-by: Andrei Vlad Birgaoanu <99738872+andreivladbrg@users.noreply.github.com> Co-authored-by: andreivladbrg <andreivladbrg@gmail.com>
- Loading branch information
1 parent
ce5b2df
commit 14b48a6
Showing
88 changed files
with
1,468 additions
and
441 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.22 <0.9.0; | ||
|
||
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
||
import { ISablierMerkleFactory } from "../../src/periphery/interfaces/ISablierMerkleFactory.sol"; | ||
import { ISablierMerkleInstant } from "../../src/periphery/interfaces/ISablierMerkleInstant.sol"; | ||
import { MerkleBase } from "../../src/periphery/types/DataTypes.sol"; | ||
|
||
import { BaseScript } from "../Base.s.sol"; | ||
|
||
contract CreateMerkleInstant is BaseScript { | ||
/// @dev Deploy via Forge. | ||
function run() public virtual broadcast returns (ISablierMerkleInstant merkleInstant) { | ||
// Prepare the constructor parameters. | ||
// TODO: Update address once deployed. | ||
ISablierMerkleFactory merkleFactory = ISablierMerkleFactory(0xF35aB407CF28012Ba57CAF5ee2f6d6E4420253bc); | ||
|
||
MerkleBase.ConstructorParams memory baseParams; | ||
baseParams.asset = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); | ||
baseParams.expiration = uint40(block.timestamp + 30 days); | ||
baseParams.initialAdmin = 0x79Fb3e81aAc012c08501f41296CCC145a1E15844; | ||
baseParams.ipfsCID = "QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"; | ||
baseParams.merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000; | ||
baseParams.name = "The Boys Instant"; | ||
|
||
uint256 campaignTotalAmount = 10_000e18; | ||
uint256 recipientCount = 100; | ||
|
||
// Deploy MerkleInstant contract. | ||
merkleInstant = merkleFactory.createMerkleInstant(baseParams, campaignTotalAmount, recipientCount); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.22 <0.9.0; | ||
|
||
import { SablierMerkleFactory } from "../../src/periphery/SablierMerkleFactory.sol"; | ||
|
||
import { BaseScript } from "../Base.s.sol"; | ||
|
||
contract DeployMerkleFactory is BaseScript { | ||
/// @dev Deploy via Forge. | ||
function run() public virtual broadcast returns (SablierMerkleFactory merkleFactory) { | ||
merkleFactory = new SablierMerkleFactory(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.22 <0.9.0; | ||
|
||
import { SablierMerkleLockupFactory } from "../../src/periphery/SablierMerkleLockupFactory.sol"; | ||
import { SablierMerkleFactory } from "../../src/periphery/SablierMerkleFactory.sol"; | ||
import { SablierBatchLockup } from "../../src/periphery/SablierBatchLockup.sol"; | ||
|
||
import { BaseScript } from "../Base.s.sol"; | ||
|
||
/// @notice Deploys all Periphery contract in the following order: | ||
/// | ||
/// 1. {SablierBatchLockup} | ||
/// 2. {SablierMerkleLockupFactory} | ||
/// 2. {SablierMerkleFactory} | ||
contract DeployPeriphery is BaseScript { | ||
/// @dev Deploy via Forge. | ||
function run() | ||
public | ||
virtual | ||
broadcast | ||
returns (SablierBatchLockup batchLockup, SablierMerkleLockupFactory merkleLockupFactory) | ||
returns (SablierBatchLockup batchLockup, SablierMerkleFactory merkleFactory) | ||
{ | ||
batchLockup = new SablierBatchLockup(); | ||
merkleLockupFactory = new SablierMerkleLockupFactory(); | ||
merkleFactory = new SablierMerkleFactory(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.