ETH Price: $3,452.01 (+1.37%)
Gas: 8 Gwei

Contract

0x300595119597b1DBbd7B4f75f5B299D17c6474De
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Redeem Statu...167209932023-02-27 17:23:11505 days ago1677518591IN
0x30059511...17c6474De
0 ETH0.0008557432
Redeem167209782023-02-27 17:20:11505 days ago1677518411IN
0x30059511...17c6474De
0 ETH0.001777423.48761073
Redeem167209462023-02-27 17:13:47505 days ago1677518027IN
0x30059511...17c6474De
0 ETH0.0022539529.78502133
Redeem167209082023-02-27 17:06:11505 days ago1677517571IN
0x30059511...17c6474De
0 ETH0.0022835330.17593996
Redeem167208962023-02-27 17:03:47505 days ago1677517427IN
0x30059511...17c6474De
0 ETH0.0026933.42704534
Redeem167208932023-02-27 17:03:11505 days ago1677517391IN
0x30059511...17c6474De
0 ETH0.002763534.34034207
Redeem167208862023-02-27 17:01:47505 days ago1677517307IN
0x30059511...17c6474De
0 ETH0.0023554729.27000367
Redeem167204972023-02-27 15:43:47505 days ago1677512627IN
0x30059511...17c6474De
0 ETH0.0024980133.0102122
Redeem167204652023-02-27 15:37:11505 days ago1677512231IN
0x30059511...17c6474De
0 ETH0.0024150631.9140166
Redeem167204232023-02-27 15:28:35505 days ago1677511715IN
0x30059511...17c6474De
0 ETH0.0027366934.00720624
Redeem167202872023-02-27 15:01:11505 days ago1677510071IN
0x30059511...17c6474De
0 ETH0.0017300729.53654427
Redeem167202842023-02-27 15:00:35505 days ago1677510035IN
0x30059511...17c6474De
0 ETH0.0021282528.12393976
Redeem167202632023-02-27 14:56:23505 days ago1677509783IN
0x30059511...17c6474De
0 ETH0.0019647224.41438708
Redeem167202552023-02-27 14:54:47505 days ago1677509687IN
0x30059511...17c6474De
0 ETH0.0018617523.13492139
Redeem167202532023-02-27 14:54:23505 days ago1677509663IN
0x30059511...17c6474De
0 ETH0.0019262723.93655179
Redeem167202512023-02-27 14:53:59505 days ago1677509639IN
0x30059511...17c6474De
0 ETH0.0016838820.9245713
Redeem167202482023-02-27 14:53:23505 days ago1677509603IN
0x30059511...17c6474De
0 ETH0.0018614623.13121862
Redeem167202462023-02-27 14:52:59505 days ago1677509579IN
0x30059511...17c6474De
0 ETH0.0019495324.22569378
Redeem167202442023-02-27 14:52:35505 days ago1677509555IN
0x30059511...17c6474De
0 ETH0.0018351322.80401285
Redeem167202242023-02-27 14:48:35505 days ago1677509315IN
0x30059511...17c6474De
0 ETH0.0017727123.42569748
Redeem167202112023-02-27 14:45:59505 days ago1677509159IN
0x30059511...17c6474De
0 ETH0.0017409523.00596825
Redeem167202082023-02-27 14:45:23505 days ago1677509123IN
0x30059511...17c6474De
0 ETH0.0016876620.97161396
Redeem167202052023-02-27 14:44:47505 days ago1677509087IN
0x30059511...17c6474De
0 ETH0.0016414120.39685166
Redeem167201972023-02-27 14:43:11505 days ago1677508991IN
0x30059511...17c6474De
0 ETH0.001704321.17838197
Redeem167201932023-02-27 14:42:23505 days ago1677508943IN
0x30059511...17c6474De
0 ETH0.0017042121.1771846
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CountyFairFleaMarket

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 3 : CountyFairFleaMarket.sol
// SPDX-License-Identifier: MIT

/// @title County Fair FLea Market
/// @notice burn and redeem contract for Negotiations With The Abyss
/// @author transientlabs.xyz

pragma solidity 0.8.17;

import {Ownable} from "Ownable.sol";

interface BurnContract {
    function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
}

interface RedeemContract {
    function externalMint(address recipient, uint256 tokenId) external;
}

contract CountyFairFleaMarket is Ownable {

    // State Variables
    bool public redeemOpen;
    BurnContract public burnContract;
    RedeemContract public redeemContract;
    mapping(uint256 => uint256) private _pointsForPrize;

    // constructor
    constructor(address burnContractAddress, address redeemContractAddress) Ownable() {
        burnContract = BurnContract(burnContractAddress);
        redeemContract = RedeemContract(redeemContractAddress);
    }

    /// @notice function to set points for a prize
    /// @dev requires owner
    function setPointsPerPrize(uint256[] calldata prizeTokenIds, uint256[] calldata prizePoints) external onlyOwner {
        require(prizeTokenIds.length == prizePoints.length, "array length mismatch");

        for (uint256 i = 0; i < prizePoints.length; i++) {
            _pointsForPrize[prizeTokenIds[i]] = prizePoints[i];
        }
    }

    /// @notice function to open/close the redeem
    /// @dev requires owner
    function setRedeemStatus(bool status) external onlyOwner {
        redeemOpen = status;
    }

    /// @notice redeem function
    function redeem(uint256 prizeTokenId) external {
        require(redeemOpen, "redeem not open");
        uint256 numToBurn = _pointsForPrize[prizeTokenId];
        require(numToBurn > 0, "invalid prize token id");
        uint256[] memory tokenIds = new uint256[](1);
        tokenIds[0] = 1;
        uint256[] memory amounts = new uint256[](1);
        amounts[0] = numToBurn;
        burnContract.burn(msg.sender, tokenIds, amounts);
        redeemContract.externalMint(msg.sender, prizeTokenId);
    }
}

File 2 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "CountyFairFleaMarket.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"burnContractAddress","type":"address"},{"internalType":"address","name":"redeemContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"burnContract","outputs":[{"internalType":"contract BurnContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"prizeTokenId","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemContract","outputs":[{"internalType":"contract RedeemContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redeemOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"prizeTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"prizePoints","type":"uint256[]"}],"name":"setPointsPerPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setRedeemStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516108a13803806108a183398101604081905261002f916100d5565b61003833610069565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055610108565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100d057600080fd5b919050565b600080604083850312156100e857600080fd5b6100f1836100b9565b91506100ff602084016100b9565b90509250929050565b61078a806101176000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80637a4473e1116100665780637a4473e1146101095780638da5cb5b1461011c578063db006a751461012d578063deffe7f814610140578063f2fde38b1461015357600080fd5b80631c0973a41461009857806371003fdc146100c8578063715018a6146100ec57806378aaae25146100f6575b600080fd5b6001546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6000546100dc90600160a01b900460ff1681565b60405190151581526020016100bf565b6100f4610166565b005b6100f46101043660046105c5565b61017a565b6002546100ab906001600160a01b031681565b6000546001600160a01b03166100ab565b6100f461013b366004610631565b61023b565b6100f461014e36600461064a565b610430565b6100f4610161366004610673565b610456565b61016e6104cf565b6101786000610529565b565b6101826104cf565b8281146101ce5760405162461bcd60e51b81526020600482015260156024820152740c2e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b60448201526064015b60405180910390fd5b60005b81811015610234578282828181106101eb576101eb61069c565b90506020020135600360008787858181106102085761020861069c565b90506020020135815260200190815260200160002081905550808061022c906106b2565b9150506101d1565b5050505050565b600054600160a01b900460ff166102865760405162461bcd60e51b815260206004820152600f60248201526e3932b232b2b6903737ba1037b832b760891b60448201526064016101c5565b600081815260036020526040902054806102db5760405162461bcd60e51b81526020600482015260166024820152751a5b9d985b1a59081c1c9a5e99481d1bdad95b881a5960521b60448201526064016101c5565b604080516001808252818301909252600091602080830190803683370190505090506001816000815181106103125761031261069c565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905082816000815181106103555761035561069c565b6020908102919091010152600154604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab9061039490339086908690600401610714565b600060405180830381600087803b1580156103ae57600080fd5b505af11580156103c2573d6000803e3d6000fd5b505060025460405163133f311360e31b8152336004820152602481018890526001600160a01b0390911692506399f988989150604401600060405180830381600087803b15801561041257600080fd5b505af1158015610426573d6000803e3d6000fd5b5050505050505050565b6104386104cf565b60008054911515600160a01b0260ff60a01b19909216919091179055565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101c5565b6104cc81610529565b50565b6000546001600160a01b031633146101785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101c5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261058b57600080fd5b50813567ffffffffffffffff8111156105a357600080fd5b6020830191508360208260051b85010111156105be57600080fd5b9250929050565b600080600080604085870312156105db57600080fd5b843567ffffffffffffffff808211156105f357600080fd5b6105ff88838901610579565b9096509450602087013591508082111561061857600080fd5b5061062587828801610579565b95989497509550505050565b60006020828403121561064357600080fd5b5035919050565b60006020828403121561065c57600080fd5b8135801515811461066c57600080fd5b9392505050565b60006020828403121561068557600080fd5b81356001600160a01b038116811461066c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016106d257634e487b7160e01b600052601160045260246000fd5b5060010190565b600081518084526020808501945080840160005b83811015610709578151875295820195908201906001016106ed565b509495945050505050565b6001600160a01b0384168152606060208201819052600090610738908301856106d9565b828103604084015261074a81856106d9565b969550505050505056fea2646970667358221220fcae50e99de33c8558240097a8d29d30e3f19042fd819c569bf8ea929ec389e564736f6c6343000811003300000000000000000000000071ce294ab5e26b3ae8d46d410e795c5265004130000000000000000000000000d2f62f16424666ac76a682ee910ca041d3bff43d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100935760003560e01c80637a4473e1116100665780637a4473e1146101095780638da5cb5b1461011c578063db006a751461012d578063deffe7f814610140578063f2fde38b1461015357600080fd5b80631c0973a41461009857806371003fdc146100c8578063715018a6146100ec57806378aaae25146100f6575b600080fd5b6001546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6000546100dc90600160a01b900460ff1681565b60405190151581526020016100bf565b6100f4610166565b005b6100f46101043660046105c5565b61017a565b6002546100ab906001600160a01b031681565b6000546001600160a01b03166100ab565b6100f461013b366004610631565b61023b565b6100f461014e36600461064a565b610430565b6100f4610161366004610673565b610456565b61016e6104cf565b6101786000610529565b565b6101826104cf565b8281146101ce5760405162461bcd60e51b81526020600482015260156024820152740c2e4e4c2f240d8cadccee8d040dad2e6dac2e8c6d605b1b60448201526064015b60405180910390fd5b60005b81811015610234578282828181106101eb576101eb61069c565b90506020020135600360008787858181106102085761020861069c565b90506020020135815260200190815260200160002081905550808061022c906106b2565b9150506101d1565b5050505050565b600054600160a01b900460ff166102865760405162461bcd60e51b815260206004820152600f60248201526e3932b232b2b6903737ba1037b832b760891b60448201526064016101c5565b600081815260036020526040902054806102db5760405162461bcd60e51b81526020600482015260166024820152751a5b9d985b1a59081c1c9a5e99481d1bdad95b881a5960521b60448201526064016101c5565b604080516001808252818301909252600091602080830190803683370190505090506001816000815181106103125761031261069c565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905082816000815181106103555761035561069c565b6020908102919091010152600154604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab9061039490339086908690600401610714565b600060405180830381600087803b1580156103ae57600080fd5b505af11580156103c2573d6000803e3d6000fd5b505060025460405163133f311360e31b8152336004820152602481018890526001600160a01b0390911692506399f988989150604401600060405180830381600087803b15801561041257600080fd5b505af1158015610426573d6000803e3d6000fd5b5050505050505050565b6104386104cf565b60008054911515600160a01b0260ff60a01b19909216919091179055565b61045e6104cf565b6001600160a01b0381166104c35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101c5565b6104cc81610529565b50565b6000546001600160a01b031633146101785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101c5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261058b57600080fd5b50813567ffffffffffffffff8111156105a357600080fd5b6020830191508360208260051b85010111156105be57600080fd5b9250929050565b600080600080604085870312156105db57600080fd5b843567ffffffffffffffff808211156105f357600080fd5b6105ff88838901610579565b9096509450602087013591508082111561061857600080fd5b5061062587828801610579565b95989497509550505050565b60006020828403121561064357600080fd5b5035919050565b60006020828403121561065c57600080fd5b8135801515811461066c57600080fd5b9392505050565b60006020828403121561068557600080fd5b81356001600160a01b038116811461066c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016106d257634e487b7160e01b600052601160045260246000fd5b5060010190565b600081518084526020808501945080840160005b83811015610709578151875295820195908201906001016106ed565b509495945050505050565b6001600160a01b0384168152606060208201819052600090610738908301856106d9565b828103604084015261074a81856106d9565b969550505050505056fea2646970667358221220fcae50e99de33c8558240097a8d29d30e3f19042fd819c569bf8ea929ec389e564736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000071ce294ab5e26b3ae8d46d410e795c5265004130000000000000000000000000d2f62f16424666ac76a682ee910ca041d3bff43d

-----Decoded View---------------
Arg [0] : burnContractAddress (address): 0x71cE294Ab5e26B3aE8d46D410E795C5265004130
Arg [1] : redeemContractAddress (address): 0xD2F62f16424666AC76a682ee910Ca041D3BFF43D

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000071ce294ab5e26b3ae8d46d410e795c5265004130
Arg [1] : 000000000000000000000000d2f62f16424666ac76a682ee910ca041d3bff43d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.