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/StakingRewards.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../security/ReentrancyGuard.sol";
import "../security/Pausable.sol";
import "../interfaces/IERC20.sol";
contract StakingRewards is ReentrancyGuard, Pausable {
IERC20 public stakingToken; IERC20 public rewardsToken;
constructor(address _stakingToken, address _rewardsToken){ stakingToken=IERC20(_stakingToken); rewardsToken=IERC20(_rewardsToken); }
}
"
},
"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/Pausable.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./Ownable.sol";
contract Pausable is Ownable {
bool public paused;
event Paused(bool status);
function setPaused(bool _p) external onlyOwner {
paused = _p;
emit Paused(_p);
}
modifier whenNotPaused() {
require(!paused, "paused");
_;
}
}
"
},
"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-06 20:49:08
Comments
Log in to comment.
No comments yet.