XL3 Chain is fully compatible with Ethereum Virtual Machine (EVM), allowing you to deploy Solidity smart contracts with minimal modifications. Enjoy faster transactions and lower gas fees.
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
[rpc_endpoints]
xl3 = "https://rpc.xl3chain.com"
[etherscan]
xl3 = { key = "YOUR_API_KEY" }// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract XL3Token is ERC20, Ownable {
constructor(
string memory name,
string memory symbol,
uint256 initialSupply
) ERC20(name, symbol) Ownable(msg.sender) {
_mint(msg.sender, initialSupply * 10**decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract XL3NFT is ERC721, Ownable {
uint256 private _tokenIdCounter;
string private _baseTokenURI;
constructor(
string memory name,
string memory symbol,
string memory baseURI
) ERC721(name, symbol) Ownable(msg.sender) {
_baseTokenURI = baseURI;
}
function mint(address to) public onlyOwner {
uint256 tokenId = _tokenIdCounter++;
_safeMint(to, tokenId);
}
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}
}