Address Details
contract
0x54053321C5FcbF497143f7462c701863a11bE013
- Contract Name
- CyberBurnTest
- Creator
- 0xc09cf2–0915af at 0x3f714d–c00954
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 0 Transactions
- Transfers
- 0 Transfers
- Gas Used
- Fetching gas used...
- Last Balance Update
- 13581078
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- CyberBurnTest
- Optimization enabled
- false
- Compiler version
- v0.8.3+commit.8d00100c
- EVM Version
- istanbul
- Verified at
- 2022-06-17T16:50:56.138225Z
contracts/carbonBurn.sol
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.3; import {ControlledSideToken} from "./Carbon/ControlledSideToken.sol"; import "./Uniswap/uniswpv2.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract CyberBurnTest { address public CARBOM = 0x32A9FE697a32135BFd313a6Ac28792DaE4D9979d; address private constant UNISWAP_V2_ROUTER = 0xE3D8bd6Aed4F159bc8000a9cD47CffDb95F96121; address private constant WETH = 0x471EcE3750Da237f93B8E339c536989b8978a438; constructor( ) public { } function uniwapCarbon(uint256 _amountIn) public returns (uint256[] memory amounts){ IERC20(WETH).approve(UNISWAP_V2_ROUTER, _amountIn); address[] memory path = new address[](2); path[0] = WETH; path[1] = CARBOM; return IUniswapV2Router(UNISWAP_V2_ROUTER).swapExactTokensForTokens(_amountIn, 0, path, address(this), block.timestamp); } function mintMonthNFT() external payable { uint256[] memory amounts = uniwapCarbon(msg.value); uint256 co2Value = amounts[amounts.length - 1]; ControlledSideToken(CARBOM).burn(co2Value); } }
/_openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
/contracts/Carbon/ControlledSideToken.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; /// @author FlowCarbon LLC /// @title The common interface of carbon credit tokens contract ControlledSideToken { function burn(uint256 amount_) public virtual {} }
/contracts/Uniswap/uniswpv2.sol
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.3; pragma experimental ABIEncoderV2; interface IUniswapV2Router { function getAmountsOut(uint256 amountIn, address[] memory path) external view returns (uint256[] memory amounts); function swapExactTokensForTokens( //amount of tokens we are sending in uint256 amountIn, //the minimum amount of tokens we want out of the trade uint256 amountOutMin, //list of token addresses we are going to trade in. this is necessary to calculate amounts address[] calldata path, //this is the address we are going to send the output tokens to address to, //the last time that the trade is valid for uint256 deadline ) external returns (uint256[] memory amounts); } interface IUniswapV2Pair { function token0() external view returns (address); function token1() external view returns (address); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; } interface IUniswapV2Factory { function getPair(address token0, address token1) external returns (address); }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"CARBOM","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintMonthNFT","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"uniwapCarbon","inputs":[{"type":"uint256","name":"_amountIn","internalType":"uint256"}]}]
Contract Creation Code
0x60806040527332a9fe697a32135bfd313a6ac28792dae4d9979d6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006457600080fd5b50610a8b806100746000396000f3fe6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061075b565b60405180910390f35b34801561007057600080fd5b5061008b600480360381019061008691906105fb565b6100cf565b604051610098919061079f565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b8152600401610134929190610776565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105d2565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107dc565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c69190610591565b915050919050565b60006103d9346100cf565b9050600081600183516103ec91906108f9565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff1660e01b815260040161048691906107c1565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505050565b60006104cf6104ca8461085b565b610836565b905080838252602082019050828560208602820111156104ee57600080fd5b60005b8581101561051e5781610504888261057c565b8452602084019350602083019250506001810190506104f1565b5050509392505050565b600082601f83011261053957600080fd5b81516105498482602086016104bc565b91505092915050565b60008151905061056181610a27565b92915050565b60008135905061057681610a3e565b92915050565b60008151905061058b81610a3e565b92915050565b6000602082840312156105a357600080fd5b600082015167ffffffffffffffff8111156105bd57600080fd5b6105c984828501610528565b91505092915050565b6000602082840312156105e457600080fd5b60006105f284828501610552565b91505092915050565b60006020828403121561060d57600080fd5b600061061b84828501610567565b91505092915050565b60006106308383610654565b60208301905092915050565b6000610648838361073d565b60208301905092915050565b61065d8161092d565b82525050565b61066c8161092d565b82525050565b600061067d826108a7565b61068781856108d7565b935061069283610887565b8060005b838110156106c35781516106aa8882610624565b97506106b5836108bd565b925050600181019050610696565b5085935050505092915050565b60006106db826108b2565b6106e581856108e8565b93506106f083610897565b8060005b83811015610721578151610708888261063c565b9750610713836108ca565b9250506001810190506106f4565b5085935050505092915050565b61073781610975565b82525050565b6107468161096b565b82525050565b6107558161096b565b82525050565b60006020820190506107706000830184610663565b92915050565b600060408201905061078b6000830185610663565b610798602083018461074c565b9392505050565b600060208201905081810360008301526107b981846106d0565b905092915050565b60006020820190506107d6600083018461074c565b92915050565b600060a0820190506107f1600083018861074c565b6107fe602083018761072e565b81810360408301526108108186610672565b905061081f6060830185610663565b61082c608083018461074c565b9695505050505050565b6000610840610851565b905061084c8282610987565b919050565b6000604051905090565b600067ffffffffffffffff821115610876576108756109e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006109048261096b565b915061090f8361096b565b925082821015610922576109216109b8565b5b828203905092915050565b60006109388261094b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109808261096b565b9050919050565b61099082610a16565b810181811067ffffffffffffffff821117156109af576109ae6109e7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a308161093f565b8114610a3b57600080fd5b50565b610a478161096b565b8114610a5257600080fd5b5056fea264697066735822122052824af187b9e9ca4ecb14c8ecc083ec448c25bf5abd5d407184bc9ae3d762f564736f6c63430008030033
Deployed ByteCode
0x6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061075b565b60405180910390f35b34801561007057600080fd5b5061008b600480360381019061008691906105fb565b6100cf565b604051610098919061079f565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b8152600401610134929190610776565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105d2565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107dc565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c69190610591565b915050919050565b60006103d9346100cf565b9050600081600183516103ec91906108f9565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff1660e01b815260040161048691906107c1565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505050565b60006104cf6104ca8461085b565b610836565b905080838252602082019050828560208602820111156104ee57600080fd5b60005b8581101561051e5781610504888261057c565b8452602084019350602083019250506001810190506104f1565b5050509392505050565b600082601f83011261053957600080fd5b81516105498482602086016104bc565b91505092915050565b60008151905061056181610a27565b92915050565b60008135905061057681610a3e565b92915050565b60008151905061058b81610a3e565b92915050565b6000602082840312156105a357600080fd5b600082015167ffffffffffffffff8111156105bd57600080fd5b6105c984828501610528565b91505092915050565b6000602082840312156105e457600080fd5b60006105f284828501610552565b91505092915050565b60006020828403121561060d57600080fd5b600061061b84828501610567565b91505092915050565b60006106308383610654565b60208301905092915050565b6000610648838361073d565b60208301905092915050565b61065d8161092d565b82525050565b61066c8161092d565b82525050565b600061067d826108a7565b61068781856108d7565b935061069283610887565b8060005b838110156106c35781516106aa8882610624565b97506106b5836108bd565b925050600181019050610696565b5085935050505092915050565b60006106db826108b2565b6106e581856108e8565b93506106f083610897565b8060005b83811015610721578151610708888261063c565b9750610713836108ca565b9250506001810190506106f4565b5085935050505092915050565b61073781610975565b82525050565b6107468161096b565b82525050565b6107558161096b565b82525050565b60006020820190506107706000830184610663565b92915050565b600060408201905061078b6000830185610663565b610798602083018461074c565b9392505050565b600060208201905081810360008301526107b981846106d0565b905092915050565b60006020820190506107d6600083018461074c565b92915050565b600060a0820190506107f1600083018861074c565b6107fe602083018761072e565b81810360408301526108108186610672565b905061081f6060830185610663565b61082c608083018461074c565b9695505050505050565b6000610840610851565b905061084c8282610987565b919050565b6000604051905090565b600067ffffffffffffffff821115610876576108756109e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006109048261096b565b915061090f8361096b565b925082821015610922576109216109b8565b5b828203905092915050565b60006109388261094b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109808261096b565b9050919050565b61099082610a16565b810181811067ffffffffffffffff821117156109af576109ae6109e7565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a308161093f565b8114610a3b57600080fd5b50565b610a478161096b565b8114610a5257600080fd5b5056fea264697066735822122052824af187b9e9ca4ecb14c8ecc083ec448c25bf5abd5d407184bc9ae3d762f564736f6c63430008030033