Address Details
contract
0x8ef65783199072F57B1cc46190471b3bB88Ff78c
- Contract Name
- CyberBurnTest
- Creator
- 0x8b2f36–66963a at 0xe11afb–21a9c0
- 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
- Fetching transactions...
- Transfers
- Fetching transfers...
- Gas Used
- Fetching gas used...
- Last Balance Update
- 13581246
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-17T17:04:52.539668Z
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: AGPL-3.0-or-later pragma solidity 0.8.3; /// @author FlowCarbon LLC /// @title The common interface of carbon credit tokens contract ControlledSideToken { function burn(uint256 amount, bytes calldata data) public {} }
/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
0x60806040527332a9fe697a32135bfd313a6ac28792dae4d9979d6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006457600080fd5b50610ad5806100746000396000f3fe6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061077e565b60405180910390f35b34801561007057600080fd5b5061008b600480360381019061008691906105fb565b6100cf565b60405161009891906107c2565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b8152600401610134929190610799565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105d2565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107e4565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c69190610591565b915050919050565b60006103d9346100cf565b9050600081600183516103ec9190610940565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe9d9303826040518263ffffffff1660e01b8152600401610486919061083e565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505050565b60006104cf6104ca84610891565b61086c565b905080838252602082019050828560208602820111156104ee57600080fd5b60005b8581101561051e5781610504888261057c565b8452602084019350602083019250506001810190506104f1565b5050509392505050565b600082601f83011261053957600080fd5b81516105498482602086016104bc565b91505092915050565b60008151905061056181610a71565b92915050565b60008135905061057681610a88565b92915050565b60008151905061058b81610a88565b92915050565b6000602082840312156105a357600080fd5b600082015167ffffffffffffffff8111156105bd57600080fd5b6105c984828501610528565b91505092915050565b6000602082840312156105e457600080fd5b60006105f284828501610552565b91505092915050565b60006020828403121561060d57600080fd5b600061061b84828501610567565b91505092915050565b60006106308383610654565b60208301905092915050565b60006106488383610760565b60208301905092915050565b61065d81610974565b82525050565b61066c81610974565b82525050565b600061067d826108dd565b610687818561090d565b9350610692836108bd565b8060005b838110156106c35781516106aa8882610624565b97506106b5836108f3565b925050600181019050610696565b5085935050505092915050565b60006106db826108e8565b6106e5818561091e565b93506106f0836108cd565b8060005b83811015610721578151610708888261063c565b975061071383610900565b9250506001810190506106f4565b5085935050505092915050565b610737816109bc565b82525050565b600061074a60008361092f565b915061075582610a6e565b600082019050919050565b610769816109b2565b82525050565b610778816109b2565b82525050565b60006020820190506107936000830184610663565b92915050565b60006040820190506107ae6000830185610663565b6107bb602083018461076f565b9392505050565b600060208201905081810360008301526107dc81846106d0565b905092915050565b600060a0820190506107f9600083018861076f565b610806602083018761072e565b81810360408301526108188186610672565b90506108276060830185610663565b610834608083018461076f565b9695505050505050565b6000604082019050610853600083018461076f565b81810360208301526108648161073d565b905092915050565b6000610876610887565b905061088282826109ce565b919050565b6000604051905090565b600067ffffffffffffffff8211156108ac576108ab610a2e565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061094b826109b2565b9150610956836109b2565b925082821015610969576109686109ff565b5b828203905092915050565b600061097f82610992565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109c7826109b2565b9050919050565b6109d782610a5d565b810181811067ffffffffffffffff821117156109f6576109f5610a2e565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b50565b610a7a81610986565b8114610a8557600080fd5b50565b610a91816109b2565b8114610a9c57600080fd5b5056fea264697066735822122037cf26b7bab93b2d3b40933cfb6ff1fb2bf599c99a887bd768f11cfa4c81e99564736f6c63430008030033
Deployed ByteCode
0x6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061077e565b60405180910390f35b34801561007057600080fd5b5061008b600480360381019061008691906105fb565b6100cf565b60405161009891906107c2565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b8152600401610134929190610799565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105d2565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107e4565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c69190610591565b915050919050565b60006103d9346100cf565b9050600081600183516103ec9190610940565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe9d9303826040518263ffffffff1660e01b8152600401610486919061083e565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505050565b60006104cf6104ca84610891565b61086c565b905080838252602082019050828560208602820111156104ee57600080fd5b60005b8581101561051e5781610504888261057c565b8452602084019350602083019250506001810190506104f1565b5050509392505050565b600082601f83011261053957600080fd5b81516105498482602086016104bc565b91505092915050565b60008151905061056181610a71565b92915050565b60008135905061057681610a88565b92915050565b60008151905061058b81610a88565b92915050565b6000602082840312156105a357600080fd5b600082015167ffffffffffffffff8111156105bd57600080fd5b6105c984828501610528565b91505092915050565b6000602082840312156105e457600080fd5b60006105f284828501610552565b91505092915050565b60006020828403121561060d57600080fd5b600061061b84828501610567565b91505092915050565b60006106308383610654565b60208301905092915050565b60006106488383610760565b60208301905092915050565b61065d81610974565b82525050565b61066c81610974565b82525050565b600061067d826108dd565b610687818561090d565b9350610692836108bd565b8060005b838110156106c35781516106aa8882610624565b97506106b5836108f3565b925050600181019050610696565b5085935050505092915050565b60006106db826108e8565b6106e5818561091e565b93506106f0836108cd565b8060005b83811015610721578151610708888261063c565b975061071383610900565b9250506001810190506106f4565b5085935050505092915050565b610737816109bc565b82525050565b600061074a60008361092f565b915061075582610a6e565b600082019050919050565b610769816109b2565b82525050565b610778816109b2565b82525050565b60006020820190506107936000830184610663565b92915050565b60006040820190506107ae6000830185610663565b6107bb602083018461076f565b9392505050565b600060208201905081810360008301526107dc81846106d0565b905092915050565b600060a0820190506107f9600083018861076f565b610806602083018761072e565b81810360408301526108188186610672565b90506108276060830185610663565b610834608083018461076f565b9695505050505050565b6000604082019050610853600083018461076f565b81810360208301526108648161073d565b905092915050565b6000610876610887565b905061088282826109ce565b919050565b6000604051905090565b600067ffffffffffffffff8211156108ac576108ab610a2e565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061094b826109b2565b9150610956836109b2565b925082821015610969576109686109ff565b5b828203905092915050565b600061097f82610992565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109c7826109b2565b9050919050565b6109d782610a5d565b810181811067ffffffffffffffff821117156109f6576109f5610a2e565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b50565b610a7a81610986565b8114610a8557600080fd5b50565b610a91816109b2565b8114610a9c57600080fd5b5056fea264697066735822122037cf26b7bab93b2d3b40933cfb6ff1fb2bf599c99a887bd768f11cfa4c81e99564736f6c63430008030033