Address Details
contract
0x28786d02e560ABce71A543F239DcA8B2120aa0F2
- Contract Name
- CyberBurnTest
- Creator
- 0xc09cf2–0915af at 0xd315f0–0d2da6
- 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
- 13581140
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-07-15T20:33:41.488728Z
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]; IERC20(CARBOM).transfer(address(0x00), 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
0x60806040527332a9fe697a32135bfd313a6ac28792dae4d9979d6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561006457600080fd5b50610a94806100746000396000f3fe6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061077f565b60405180910390f35b34801561007057600080fd5b5061008b6004803603810190610086919061061f565b6100cf565b60405161009891906107c3565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b815260040161013492919061079a565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105f6565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107e5565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c691906105b5565b915050919050565b60006103d9346100cf565b9050600081600183516103ec9190610902565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000836040518363ffffffff1660e01b815260040161048992919061079a565b602060405180830381600087803b1580156104a357600080fd5b505af11580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db91906105f6565b505050565b60006104f36104ee84610864565b61083f565b9050808382526020820190508285602086028201111561051257600080fd5b60005b85811015610542578161052888826105a0565b845260208401935060208301925050600181019050610515565b5050509392505050565b600082601f83011261055d57600080fd5b815161056d8482602086016104e0565b91505092915050565b60008151905061058581610a30565b92915050565b60008135905061059a81610a47565b92915050565b6000815190506105af81610a47565b92915050565b6000602082840312156105c757600080fd5b600082015167ffffffffffffffff8111156105e157600080fd5b6105ed8482850161054c565b91505092915050565b60006020828403121561060857600080fd5b600061061684828501610576565b91505092915050565b60006020828403121561063157600080fd5b600061063f8482850161058b565b91505092915050565b60006106548383610678565b60208301905092915050565b600061066c8383610761565b60208301905092915050565b61068181610936565b82525050565b61069081610936565b82525050565b60006106a1826108b0565b6106ab81856108e0565b93506106b683610890565b8060005b838110156106e75781516106ce8882610648565b97506106d9836108c6565b9250506001810190506106ba565b5085935050505092915050565b60006106ff826108bb565b61070981856108f1565b9350610714836108a0565b8060005b8381101561074557815161072c8882610660565b9750610737836108d3565b925050600181019050610718565b5085935050505092915050565b61075b8161097e565b82525050565b61076a81610974565b82525050565b61077981610974565b82525050565b60006020820190506107946000830184610687565b92915050565b60006040820190506107af6000830185610687565b6107bc6020830184610770565b9392505050565b600060208201905081810360008301526107dd81846106f4565b905092915050565b600060a0820190506107fa6000830188610770565b6108076020830187610752565b81810360408301526108198186610696565b90506108286060830185610687565b6108356080830184610770565b9695505050505050565b600061084961085a565b90506108558282610990565b919050565b6000604051905090565b600067ffffffffffffffff82111561087f5761087e6109f0565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061090d82610974565b915061091883610974565b92508282101561092b5761092a6109c1565b5b828203905092915050565b600061094182610954565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061098982610974565b9050919050565b61099982610a1f565b810181811067ffffffffffffffff821117156109b8576109b76109f0565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a3981610948565b8114610a4457600080fd5b50565b610a5081610974565b8114610a5b57600080fd5b5056fea26469706673582212207055063f122977b82a7ea1a625a84c6f05d1cdc85015660eef18fad9361d9e6f64736f6c63430008030033
Deployed ByteCode
0x6080604052600436106100345760003560e01c806331d9387c146100395780636ede110714610064578063b3c89747146100a1575b600080fd5b34801561004557600080fd5b5061004e6100ab565b60405161005b919061077f565b60405180910390f35b34801561007057600080fd5b5061008b6004803603810190610086919061061f565b6100cf565b60405161009891906107c3565b60405180910390f35b6100a96103ce565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606073471ece3750da237f93b8e339c536989b8978a43873ffffffffffffffffffffffffffffffffffffffff1663095ea7b373e3d8bd6aed4f159bc8000a9cd47cffdb95f96121846040518363ffffffff1660e01b815260040161013492919061079a565b602060405180830381600087803b15801561014e57600080fd5b505af1158015610162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018691906105f6565b506000600267ffffffffffffffff8111156101ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156101f85781602001602082028036833780820191505090505b50905073471ece3750da237f93b8e339c536989b8978a4388160008151811061024a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816001815181106102df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505073e3d8bd6aed4f159bc8000a9cd47cffdb95f9612173ffffffffffffffffffffffffffffffffffffffff166338ed17398460008430426040518663ffffffff1660e01b815260040161036f9594939291906107e5565b600060405180830381600087803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906103c691906105b5565b915050919050565b60006103d9346100cf565b9050600081600183516103ec9190610902565b81518110610423577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000836040518363ffffffff1660e01b815260040161048992919061079a565b602060405180830381600087803b1580156104a357600080fd5b505af11580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db91906105f6565b505050565b60006104f36104ee84610864565b61083f565b9050808382526020820190508285602086028201111561051257600080fd5b60005b85811015610542578161052888826105a0565b845260208401935060208301925050600181019050610515565b5050509392505050565b600082601f83011261055d57600080fd5b815161056d8482602086016104e0565b91505092915050565b60008151905061058581610a30565b92915050565b60008135905061059a81610a47565b92915050565b6000815190506105af81610a47565b92915050565b6000602082840312156105c757600080fd5b600082015167ffffffffffffffff8111156105e157600080fd5b6105ed8482850161054c565b91505092915050565b60006020828403121561060857600080fd5b600061061684828501610576565b91505092915050565b60006020828403121561063157600080fd5b600061063f8482850161058b565b91505092915050565b60006106548383610678565b60208301905092915050565b600061066c8383610761565b60208301905092915050565b61068181610936565b82525050565b61069081610936565b82525050565b60006106a1826108b0565b6106ab81856108e0565b93506106b683610890565b8060005b838110156106e75781516106ce8882610648565b97506106d9836108c6565b9250506001810190506106ba565b5085935050505092915050565b60006106ff826108bb565b61070981856108f1565b9350610714836108a0565b8060005b8381101561074557815161072c8882610660565b9750610737836108d3565b925050600181019050610718565b5085935050505092915050565b61075b8161097e565b82525050565b61076a81610974565b82525050565b61077981610974565b82525050565b60006020820190506107946000830184610687565b92915050565b60006040820190506107af6000830185610687565b6107bc6020830184610770565b9392505050565b600060208201905081810360008301526107dd81846106f4565b905092915050565b600060a0820190506107fa6000830188610770565b6108076020830187610752565b81810360408301526108198186610696565b90506108286060830185610687565b6108356080830184610770565b9695505050505050565b600061084961085a565b90506108558282610990565b919050565b6000604051905090565b600067ffffffffffffffff82111561087f5761087e6109f0565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061090d82610974565b915061091883610974565b92508282101561092b5761092a6109c1565b5b828203905092915050565b600061094182610954565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061098982610974565b9050919050565b61099982610a1f565b810181811067ffffffffffffffff821117156109b8576109b76109f0565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b610a3981610948565b8114610a4457600080fd5b50565b610a5081610974565b8114610a5b57600080fd5b5056fea26469706673582212207055063f122977b82a7ea1a625a84c6f05d1cdc85015660eef18fad9361d9e6f64736f6c63430008030033