Commit 87924b78 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update receive eth

parent e5d70fb2
...@@ -37,6 +37,7 @@ contract Distribution is IDistribution, Ownable, Pausable, ReentrancyGuard { ...@@ -37,6 +37,7 @@ contract Distribution is IDistribution, Ownable, Pausable, ReentrancyGuard {
require(MerkleProof.verifyCalldata(proof, _merkleRoot(), leaf), "Invalid proof"); require(MerkleProof.verifyCalldata(proof, _merkleRoot(), leaf), "Invalid proof");
uint256 userCanClaimAmount = userAllAmount - userClaimed[msg.sender]; uint256 userCanClaimAmount = userAllAmount - userClaimed[msg.sender];
require(userCanClaimAmount > 0, "Nothing to claim");
userClaimed[msg.sender] = userAllAmount; userClaimed[msg.sender] = userAllAmount;
transferToken(msg.sender, userCanClaimAmount); transferToken(msg.sender, userCanClaimAmount);
emit Claimed(msg.sender, userCanClaimAmount, userAllAmount); emit Claimed(msg.sender, userCanClaimAmount, userAllAmount);
...@@ -54,4 +55,6 @@ contract Distribution is IDistribution, Ownable, Pausable, ReentrancyGuard { ...@@ -54,4 +55,6 @@ contract Distribution is IDistribution, Ownable, Pausable, ReentrancyGuard {
function claimedOf() public view returns (uint256){ function claimedOf() public view returns (uint256){
return userClaimed[msg.sender]; return userClaimed[msg.sender];
} }
receive() external payable{}
} }
\ No newline at end of file
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
}, },
networks: { networks: {
testnet: { testnet: {
url: 'https://dev.rpc.agicoin.ai', url: 'https://dev.rpc.aonet.ai',
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [] accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : []
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment