Smart contract repository for the MergeOS token on TRON.
| Field | Value |
|---|---|
| Token name | MergeOS |
| Symbol | MRG |
| Standard | TRC20-compatible |
| Network | TRON / TVM |
| Decimals | 18 |
| Contract | contracts/MRGToken.sol |
| Solidity | ^0.8.0 |
| License | MIT |
MRGToken is a self-contained TRC20-compatible token contract. It does not import external libraries, so it can be compiled directly in Tron-IDE, Remix, TronBox, or with solc.
- Standard TRC20 interface:
totalSupply()balanceOf(address)transfer(address,uint256)approve(address,uint256)transferFrom(address,address,uint256)allowance(address,address)
- Standard events:
Transfer(address,address,uint256)Approval(address,address,uint256)
- Owner-controlled minting.
- Holder burn and approved burn.
- Ownership transfer and ownership renounce.
- 18-decimal token precision.
contracts/
MRGToken.sol
constructor(uint256 initialSupply)initialSupply is provided as whole MRG tokens. The constructor multiplies it by 10 ** decimals and mints the full amount to the deployer.
Examples:
| Constructor value | Minted supply |
|---|---|
1000000 |
1,000,000 MRG |
1000000000 |
1,000,000,000 MRG |
TRC20 transfer amounts use the smallest unit, like ERC20. Because MRG has 18 decimals:
1 MRG = 1_000_000_000_000_000_000 base units
The constructor is the only function that accepts whole-token supply. Runtime functions such as transfer, approve, mint, burn, and burnFrom use base units.
Example: to mint 100 MRG after deployment, call:
mint(account, 100000000000000000000)
With local Solidity compiler:
solc --bin --abi contracts/MRGToken.solThe contract has been checked locally with:
solc 0.8.25
For Tron-IDE:
- Open Tron-IDE.
- Create or import
contracts/MRGToken.sol. - Select a Solidity
0.8.xcompiler compatible with TRON. - Compile the contract.
- Keep the exact compiler and optimization settings for later verification.
Deploy contract MRGToken with one constructor argument:
initialSupply: number of whole MRG tokens to mint to the deployer
Example for 1 billion MRG:
initialSupply = 1000000000
After deployment:
- Confirm
name()returnsMergeOS. - Confirm
symbol()returnsMRG. - Confirm
decimals()returns18. - Confirm
owner()returns the deployer address. - Confirm
balanceOf(deployer)equalsinitialSupply * 10 ** 18.
Mints amount base units to account. Only the owner can call this function.
Transfers owner privileges to newOwner.
Removes the owner permanently by setting owner to the zero address. After this, owner-only minting is disabled forever.
Burns amount base units from the caller.
Burns amount base units from account using the caller's allowance.
- The owner can mint more tokens until ownership is renounced or transferred to a governance or treasury address.
- Do not renounce ownership until the tokenomics and distribution plan are final.
- Use a secure deployer wallet and back up private keys before deployment.
- Test on Nile or Shasta testnet before deploying to TRON mainnet.
- Verify the deployed contract using the same compiler and optimization settings used for deployment.
- Never commit
.env, private keys, seed phrases, or deployment secrets. This repository ignores.envand.env.*.
- TRON Developer Hub: https://developers.tron.network/
- TRC20 protocol interface: https://developers.tron.network/docs/trc20-protocol-interface
- Tron-IDE: https://www.tronide.io/
Current tracked contract:
contracts/MRGToken.sol
No deployment address is included yet. Add the deployed TRON contract address here after mainnet or testnet deployment.