FLT 相关合约地址
- FLT-Drop 合约地址: 0x6081d7F04a8c31e929f25152d4ad37c83638C62b
- FLT-Drop Token 简述: Fluence Drop (FLT-DROP) Token Tracker | Etherscan
- FLT 合约地址:0x236501327e701692a281934230AF0b6BE8Df3353
- FLT Token 简述: Fluence (FLT) Token Tracker | Etherscan FLT 的交易
- UniswapV3: https://app.uniswap.org/explore/tokens/ethereum/0x236501327e701692a281934230af0b6be8df3353
- GateIO: Cryptocurrency Prices | Crypto & Coin Market Cap | Gate.io 在本地 Claim FLT Drop 的 Gist
- FLT DROP (github.com)
FLT Drop 合约代码分析
相关核心代码位于 DevRewardDistributor.sol
claimTokens
用于验证用户提交的 proof,并兑现FLT-Drop
奖励
function claimTokens(
uint32 userId,
bytes32[] calldata merkleProof,
address temporaryAddress,
bytes calldata signature
) external whenClaimingIs(true) {
require(!isClaimed(userId), "Tokens already claimed");
require(lockedBalances[msg.sender].unlockTime == 0, "Tokens are already locked");
uint256 amount = currentReward();
uint256 claimedSupply_ = claimedSupply;
require(claimedSupply_ + amount \<= maxClaimedSupply, "Total claimed exceeded max limit");
bytes32 leaf = keccak256(abi.encodePacked(userId, temporaryAddress));
require(MerkleProof.verify(merkleProof, merkleRoot, leaf), "Valid proof required");
bytes32 msgHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n20", msg.sender));
address signer = ECDSA.recover(msgHash, signature);
require(signer == temporaryAddress, "Invalid signature");
_setClaimed(userId);
lockedBalances[msg.sender] = LockedBalance({amount: amount, unlockTime: block.timestamp + lockupPeriod});
_totalSupply += amount;
claimedSupply = claimedSupply_ + amount;
emit Transfer(address(0x00), msg.sender, amount);
emit Claimed(userId, msg.sender, amount, leaf);
}
transfer
用于将FLT-Drop
兑换成 FLT
第三个 require 约束了当前的 blocktime 必须大于 unlockTime
function transfer(address to, uint256 value) external returns (bool) {
require(value \> 0, "Value is 0");
require(lockedBalances[msg.sender].amount == value, "Invalid amount");
require(block.timestamp \> lockedBalances[msg.sender].unlockTime, "Tokens are locked");
lockedBalances[msg.sender].amount = 0;
_totalSupply -= value;
IERC20(token).safeTransfer(msg.sender, value);
emit Transfer(msg.sender, address(0x00), value);
return true;
}
合约 constructor
中的核心参数
constructor(
FluenceToken _token,
Executor _executor,
bytes32 _merkleRoot,
uint256 _halvePeriod,
uint256 _lockupPeriod,
uint256 _initialReward,
uint256 _claimingPeriod,
address _canceler,
uint256 _maxClaimedSupply
)
FLT Drop 合约初始参数分析
合约创建于 0xa71c**754068
Ethereum Transaction Hash (Txhash) Details | Etherscan
简单根据关键参数逆向一下,可以得知合约初始化时的一些关键参数
000000000000000000000000236501327e701692a281934230af0b6be8df3353 #FLT token address
000000000000000000000000f5693bbe961f166a2fe96094d25567f7517f27b7 #_executor
9054c3420799d2857b3706ca310823473c3b76dd666412134952aeba279e888a #_merkleRoot
000000000000000000000000000000000000000000000000000000000076a700 #_halvePeriod --\> 2160h==90day
00000000000000000000000000000000000000000000000000000000004f1a00 #_lockupPeriod --\> 1440h==60day
00000000000000000000000000000000000000000000010f0cf064dd59200000 #initialReward
0000000000000000000000000000000000000000000000000000000001e13380 #claimingPeriod
0000000000000000000000007f629403fdcc02ad83aa5debd1d4b1548982afac #_caceler
000000000000000000000000000000000000000000295be96e64066972000000 #_maxclaimedSupply