Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions claim_contracts/script-config/config.example.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"foundation": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
"tokenDistributor": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"limitTimestampToClaim": 2733427549,
"claimMerkleRoot": "0x90076b5fb9a6c81d9fce83dfd51760987b8c49e7c861ea25b328e6e63d2cd3df",
"airdropProxy": "0x882b82f4E9014164Af87ecdAB64955cf7C252C4f",
"tokenProxy": "0x2E983A1Ba5e8b38AAAeC4B440B9dDcFBf72E15d1"
}
3 changes: 0 additions & 3 deletions claim_contracts/script-config/config.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"foundation": "",
"tokenDistributor": "",

"limitTimestampToClaim": 2733427549,
"claimMerkleRoot": "",
"tokenProxy": "0x0000000000000000000000000000000000000000"
}
16 changes: 2 additions & 14 deletions claim_contracts/script/DeployClaimableAirdrop.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ contract DeployAlignedToken is Script {
".tokenDistributor"
);
address _tokenProxy = stdJson.readAddress(config_json, ".tokenProxy");
uint256 _limitTimestampToClaim = stdJson.readUint(
config_json,
".limitTimestampToClaim"
);
bytes32 _claimMerkleRoot = stdJson.readBytes32(
config_json,
".claimMerkleRoot"
);

vm.broadcast();
ClaimableAirdrop _airdrop = new ClaimableAirdrop();
Expand All @@ -50,9 +42,7 @@ contract DeployAlignedToken is Script {
address(_airdrop),
_foundation,
_tokenProxy,
_tokenDistributor,
_limitTimestampToClaim,
_claimMerkleRoot
_tokenDistributor
)
);

Expand All @@ -61,9 +51,7 @@ contract DeployAlignedToken is Script {
address(_airdrop),
_foundation,
_tokenProxy,
_tokenDistributor,
_limitTimestampToClaim,
_claimMerkleRoot
_tokenDistributor
);

console.log(
Expand Down
24 changes: 6 additions & 18 deletions claim_contracts/script/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ library Utils {
address _implementation,
address _owner,
address _tokenContractAddress,
address _tokenOwnerAddress,
uint256 _limitTimestampToClaim,
bytes32 _claimMerkleRoot
address _tokenOwnerAddress
) internal pure returns (bytes memory) {
return
abi.encodePacked(
Expand All @@ -154,9 +152,7 @@ library Utils {
_implementation,
_owner,
_tokenContractAddress,
_tokenOwnerAddress,
_limitTimestampToClaim,
_claimMerkleRoot
_tokenOwnerAddress
)
)
);
Expand All @@ -166,19 +162,15 @@ library Utils {
address _implementation,
address _foundation,
address _tokenContractAddress,
address _tokenOwnerAddress,
uint256 _limitTimestampToClaim,
bytes32 _claimMerkleRoot
address _tokenOwnerAddress
) internal pure returns (bytes memory) {
return
abi.encodeCall(
ClaimableAirdrop(_implementation).initialize,
(
_foundation,
_tokenContractAddress,
_tokenOwnerAddress,
_limitTimestampToClaim,
_claimMerkleRoot
_tokenOwnerAddress
)
);
}
Expand All @@ -187,9 +179,7 @@ library Utils {
address _implementation,
address _foundation,
address _tokenProxy,
address _tokenDistributor,
uint256 _limitTimestampToClaim,
bytes32 _claimMerkleRoot
address _tokenDistributor
) internal pure returns (bytes memory) {
return
abi.encode(
Expand All @@ -199,9 +189,7 @@ library Utils {
_implementation,
_foundation,
_tokenProxy,
_tokenDistributor,
_limitTimestampToClaim,
_claimMerkleRoot
_tokenDistributor
)
);
}
Expand Down
33 changes: 11 additions & 22 deletions claim_contracts/src/ClaimableAirdrop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,28 @@ contract ClaimableAirdrop is

/// @notice Initializes the contract.
/// @dev This initializer should be called only once.
/// @param _owner address of the owner of the token.
/// @param _foundation address of the Aligned foundation.
/// @param _tokenProxy address of the token contract.
/// @param _tokenDistributor address of the wallet that has the tokens to distribute to the claimants.
/// @param _limitTimestampToClaim timestamp until which the claimants can claim the tokens.
/// @param _claimMerkleRoot Merkle root of the claimants.
function initialize(
address _owner,
address _foundation,
address _tokenProxy,
address _tokenDistributor,
uint256 _limitTimestampToClaim,
bytes32 _claimMerkleRoot
address _tokenDistributor
) external initializer {
require(_owner != address(0), "Invalid owner address");
require(
_tokenProxy != address(0) && _tokenProxy != address(this),
"Invalid token contract address"
);
require(
_tokenDistributor != address(0) &&
_tokenDistributor != address(this),
"Invalid token owner address"
);
require(_limitTimestampToClaim > block.timestamp, "Invalid timestamp");
require(_claimMerkleRoot != 0, "Invalid Merkle root");
require(_foundation != address(0), "Invalid foundation address");
require(_tokenProxy != address(0), "Invalid token contract address");
require(_tokenDistributor != address(0), "Invalid token owner address");

__Ownable_init(_owner);
__Ownable_init(_foundation);
__Pausable_init();
__ReentrancyGuard_init();

tokenProxy = _tokenProxy;
tokenDistributor = _tokenDistributor;
limitTimestampToClaim = _limitTimestampToClaim;
claimMerkleRoot = _claimMerkleRoot;
limitTimestampToClaim = 0;
claimMerkleRoot = 0;

_pause();
}

/// @notice Claim the tokens.
Expand Down