Description:
ERC20 token contract with Factory capabilities. Standard implementation for fungible tokens on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/farming/MasterChef.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../interfaces/IERC20.sol";
import "../security/Ownable.sol";
import "../security/ReentrancyGuard.sol";
contract MasterChef is Ownable, ReentrancyGuard {
IERC20 public rewardToken;
uint256 public rewardPerBlock;
uint256 public startBlock;
constructor(address _rewardToken, uint256 _rewardPerBlock, uint256 _startBlock){
rewardToken = IERC20(_rewardToken); rewardPerBlock=_rewardPerBlock; startBlock=_startBlock;
}
}
"
},
"contracts/interfaces/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
"
},
"contracts/security/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); }
modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; }
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "0 addr");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
"
},
"contracts/security/ReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() { _status = _NOT_ENTERED; }
modifier nonReentrant() {
require(_status != _ENTERED, "reentrant");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 500
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-11-07 10:34:50
Comments
Log in to comment.
No comments yet.