TestPresaleETH

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

interface ILayerZeroEndpointV2 {
    struct Origin {
        uint32 srcEid;
        bytes32 sender;
        uint64 nonce;
    }
}

contract TestPresaleETH {
    address public lzEndpoint;
    address public owner;
    
    mapping(address => uint) public allocations;
    
    event TokensAllocated(address buyer, uint amount);
    
    constructor() {
        lzEndpoint = 0x1a44076050125825900e736c501f859c50fE728c;
        owner = msg.sender;
    }
    
    // LayerZero callback
    function lzReceive(
        ILayerZeroEndpointV2.Origin calldata _origin,
        bytes32 _guid,
        bytes calldata _message,
        address _executor,
        bytes calldata _extraData
    ) external payable {
        require(msg.sender == lzEndpoint, "Only endpoint");
        
        (address buyer, uint amount) = abi.decode(_message, (address, uint));
        
        allocations[buyer] += amount;
        
        emit TokensAllocated(buyer, amount);
    }
    
    function checkAllocation(address user) external view returns (uint) {
        return allocations[user];
    }
}

Tags:
addr:0xf3f39a777a81e95e779546dd379fb6a6a35da552|verified:true|block:23558591|tx:0x55b45c70f23d63d15732d2f9281084824a59ccc7946d2b166f8bea7a8dc9ffbe|first_check:1760287555

Submitted on: 2025-10-12 18:45:58

Comments

Log in to comment.

No comments yet.