Contract 0x4889F13B4A5417861BECaB38bbB47A0E8A619972 1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x07983172b444b935e9bf09c949e3769c358e4c10958b0082f539687f6780fd0dSet Buddy Logic ...282845902022-05-13 22:48:1911 days 20 hrs agoMicroBuddies: Deployer IN  0x4889f13b4a5417861becab38bbb47a0e8a6199720 MATIC0.0017384460
0x4941ff7474a4f67287c9b6b8287138d0a129056150532490e87e5b894aa20ca8Withdraw Link226247162021-12-17 8:30:18159 days 10 hrs agoMicroBuddies: Deployer IN  0x4889f13b4a5417861becab38bbb47a0e8a6199720 MATIC0.0015034635
0x68319a7ff33c1c54323a314ba26858bf35d08a92cd26314f48a2af27c207f92fSet Buddy Synthe...226220132021-12-17 6:50:53159 days 12 hrs agoMicroBuddies: Deployer IN  0x4889f13b4a5417861becab38bbb47a0e8a6199720 MATIC0.0032222470
0xa8c32c0d30204118c1287e95ce5023a209e8bc5658fb746114b8f3fbd82f00eeSet Buddy Logic ...226220122021-12-17 6:50:51159 days 12 hrs agoMicroBuddies: Deployer IN  0x4889f13b4a5417861becab38bbb47a0e8a6199720 MATIC0.0032251870
0xd87f83a6d9bb6c531d5338b2f10c34a89d6545ff873b51eacd06b26cb9c41ccdSet Buddy Core A...226220112021-12-17 6:50:49159 days 12 hrs agoMicroBuddies: Deployer IN  0x4889f13b4a5417861becab38bbb47a0e8a6199720 MATIC0.0032318370
0x2c9d56f691d71a8438dd3bc5465dad78ecbdb85946bb4987df9c787cd7bc67360x60c06040226220012021-12-17 6:50:29159 days 12 hrs agoMicroBuddies: Deployer IN  Create: BuddyRandomness0 MATIC0.0647831170
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BuddyRandomness

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 336 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : BuddyRandomness.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

// |  \/  (_)              |  _ \          | |   | (_)
// | \  / |_  ___ _ __ ___ | |_) |_   _  __| | __| |_  ___  ___ ™
// | |\/| | |/ __| '__/ _ \|  _ <| | | |/ _` |/ _` | |/ _ \/ __|
// | |  | | | (__| | | (_) | |_) | |_| | (_| | (_| | |  __/\__ \
// |_|  |_|_|\___|_|  \___/|____/ \__,_|\__,_|\__,_|_|\___||___/ 2021

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IBuddyRandomness.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";

contract BuddyRandomness is IBuddyRandomness, VRFConsumerBase, Ownable {
    address public _buddyCore;
    address public _buddyLogic;
    address public _buddySynthesizer;

    bytes32 internal keyHash;
    uint256 internal fee;

    mapping(uint256 => uint256[]) internal _randoms;
    mapping(bytes32 => uint256) internal requests;

    constructor()
        VRFConsumerBase(
            0x3d2341ADb2D31f1c5530cDC622016af293177AE0, // VRF Coordinator
            0xb0897686c545045aFc77CF20eC7A532E3120E0F1 // LINK Token
        )
    {
        keyHash = 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da;
        fee = 0.0001 * 10**18;
    }

    function setBuddyCoreAddr(address buddyCoreAddr) public onlyOwner {
        require(address(_buddyCore) == address(0), "Buddy addr already set");
        _buddyCore = buddyCoreAddr;
    }

    function setBuddyLogicAddr(address buddyLogicAddr) public onlyOwner {
        _buddyLogic = buddyLogicAddr;
    }

    function setBuddySynthesizerAddr(address buddySynthesizerAddr)
        public
        onlyOwner
    {
        _buddySynthesizer = buddySynthesizerAddr;
    }

    modifier onlyBuddyCore() {
        require(msg.sender == _buddyCore, "Unauthorized");
        _;
    }

    modifier onlyApproved() {
        require(
            msg.sender == _buddyLogic || msg.sender == _buddySynthesizer,
            "Unauthorized"
        );
        _;
    }

    function withdrawLink() external onlyOwner {
        uint256 balance = LINK.balanceOf(address(this));
        require(balance > 0, "No Link");
        LINK.transfer(owner(), balance);
    }

    uint256 nonce;

    function generateRandom(uint256 tokenId) external override onlyBuddyCore {
        requests[getRandomNumber()] = tokenId;
    }

    function getRandomResult(uint256 tokenId)
        external
        view
        override
        onlyBuddyCore
        returns (uint256)
    {
        return _randoms[tokenId].length;
    }

    function rng(uint256 tokenId, uint256 max)
        external
        override
        onlyApproved
        returns (uint256 rand)
    {
        return rollNewGuess(tokenId, max);
    }

    function rollNewGuess(uint256 tokenId, uint256 max)
        private
        returns (uint256 rand)
    {
        if (max == 0) {
            return 0;
        }

        uint256[] storage nonces = _randoms[tokenId];
        uint256 randomResult = nonces[nonces.length - 1];
        rand =
            (uint256(keccak256(abi.encode(randomResult, nonces.length))) %
                max) +
            1;

        _randoms[tokenId].push(randomResult);
    }

    /**
     * Requests randomness
     */
    function getRandomNumber() private returns (bytes32 requestId) {
        require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK to rng");
        return requestRandomness(keyHash, fee);
    }

    /**
     * Callback function used by VRF Coordinator
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness)
        internal
        override
    {
        uint256 tokenId = requests[requestId];
        uint256 length = _randoms[tokenId].length;

        if (length == 0) {
            _randoms[tokenId] = [randomness];
        } else {
            _randoms[tokenId].push(randomness);
        }
    }
}

File 2 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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);
}

File 3 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/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() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 8 : IBuddyRandomness.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IBuddyRandomness {
    function generateRandom(uint256) external;

    function getRandomResult(uint256) external view returns (uint256);

    function rng(uint256, uint256) external returns (uint256);
}

File 5 of 8 : VRFConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constuctor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator, _link) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.)
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBase expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomness the VRF output
   */
  function fulfillRandomness(
    bytes32 requestId,
    uint256 randomness
  )
    internal
    virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 constant private USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(
    bytes32 _keyHash,
    uint256 _fee
  )
    internal
    returns (
      bytes32 requestId
    )
  {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed  = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface immutable internal LINK;
  address immutable private vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(
    address _vrfCoordinator,
    address _link
  ) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(
    bytes32 requestId,
    uint256 randomness
  )
    external
  {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 6 of 8 : Context.sol
// SPDX-License-Identifier: MIT

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;
    }
}

File 7 of 8 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {

  function allowance(
    address owner,
    address spender
  )
    external
    view
    returns (
      uint256 remaining
    );

  function approve(
    address spender,
    uint256 value
  )
    external
    returns (
      bool success
    );

  function balanceOf(
    address owner
  )
    external
    view
    returns (
      uint256 balance
    );

  function decimals()
    external
    view
    returns (
      uint8 decimalPlaces
    );

  function decreaseApproval(
    address spender,
    uint256 addedValue
  )
    external
    returns (
      bool success
    );

  function increaseApproval(
    address spender,
    uint256 subtractedValue
  ) external;

  function name()
    external
    view
    returns (
      string memory tokenName
    );

  function symbol()
    external
    view
    returns (
      string memory tokenSymbol
    );

  function totalSupply()
    external
    view
    returns (
      uint256 totalTokensIssued
    );

  function transfer(
    address to,
    uint256 value
  )
    external
    returns (
      bool success
    );

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  )
    external
    returns (
      bool success
    );

  function transferFrom(
    address from,
    address to,
    uint256 value
  )
    external
    returns (
      bool success
    );

}

File 8 of 8 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {

  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  )
    internal
    pure
    returns (
      uint256
    )
  {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(
    bytes32 _keyHash,
    uint256 _vRFInputSeed
  )
    internal
    pure
    returns (
      bytes32
    )
  {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 336
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"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":"_buddyCore","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_buddyLogic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_buddySynthesizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"generateRandom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRandomResult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"rng","outputs":[{"internalType":"uint256","name":"rand","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"buddyCoreAddr","type":"address"}],"name":"setBuddyCoreAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"buddyLogicAddr","type":"address"}],"name":"setBuddyLogicAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"buddySynthesizerAddr","type":"address"}],"name":"setBuddySynthesizerAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405234801561001057600080fd5b50733d2341adb2d31f1c5530cdc622016af293177ae060a05273b0897686c545045afc77cf20ec7a532e3120e0f160805261004a3361007d565b7ff86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da600555655af3107a40006006556100cf565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60805160a051610e876101106000396000818161065a0152610afa0152600081816104d201528181610583015281816109310152610acb0152610e876000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638dc654a21161008c578063b0e42b6711610066578063b0e42b67146101c2578063ed30a6d4146101d5578063f13fad54146101e8578063f2fde38b146101fb57600080fd5b80638dc654a21461019457806394985ddd1461019c578063aea2035f146101af57600080fd5b806366947688116100c8578063669476881461013d578063715018a614610150578063776e8eee146101585780638da5cb5b1461018357600080fd5b80630ae6a811146100ef5780630cff933614610104578063530104081461012a575b600080fd5b6101026100fd366004610ca1565b61020e565b005b610117610112366004610cd1565b61027d565b6040519081526020015b60405180910390f35b610102610138366004610cf3565b6102f1565b61010261014b366004610ca1565b61035b565b61010261041e565b60035461016b906001600160a01b031681565b6040516001600160a01b039091168152602001610121565b6001546001600160a01b031661016b565b610102610472565b6101026101aa366004610cd1565b61064f565b6101176101bd366004610cf3565b6106d1565b60045461016b906001600160a01b031681565b60025461016b906001600160a01b031681565b6101026101f6366004610ca1565b610730565b610102610209366004610ca1565b61079a565b6001546001600160a01b0316331461025b5760405162461bcd60e51b81526020600482018190526024820152600080516020610e3283398151915260448201526064015b60405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546000906001600160a01b03163314806102a357506004546001600160a01b031633145b6102de5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610252565b6102e88383610853565b90505b92915050565b6002546001600160a01b0316331461033a5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610252565b806008600061034761090d565b815260208101919091526040016000205550565b6001546001600160a01b031633146103a35760405162461bcd60e51b81526020600482018190526024820152600080516020610e328339815191526044820152606401610252565b6002546001600160a01b0316156103fc5760405162461bcd60e51b815260206004820152601660248201527f4275646479206164647220616c726561647920736574000000000000000000006044820152606401610252565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146104665760405162461bcd60e51b81526020600482018190526024820152600080516020610e328339815191526044820152606401610252565b61047060006109fd565b565b6001546001600160a01b031633146104ba5760405162461bcd60e51b81526020600482018190526024820152600080516020610e328339815191526044820152606401610252565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610521573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105459190610d0c565b9050600081116105815760405162461bcd60e51b81526020600482015260076024820152664e6f204c696e6b60c81b6044820152606401610252565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6105c26001546001600160a01b031690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190610d25565b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106c75760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610252565b61064b8282610a4f565b6002546000906001600160a01b0316331461071d5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610252565b5060009081526007602052604090205490565b6001546001600160a01b031633146107785760405162461bcd60e51b81526020600482018190526024820152600080516020610e328339815191526044820152606401610252565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146107e25760405162461bcd60e51b81526020600482018190526024820152600080516020610e328339815191526044820152606401610252565b6001600160a01b0381166108475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b610850816109fd565b50565b600081610862575060006102eb565b60008381526007602052604081208054909190829061088390600190610d5d565b8154811061089357610893610d74565b60009182526020918290200154835460408051938401839052830152915084906060016040516020818303038152906040528051906020012060001c6108d99190610d8a565b6108e4906001610dac565b600095865260076020908152604087208054600181018255908852962090950155509192915050565b6006546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610978573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099c9190610d0c565b10156109ea5760405162461bcd60e51b815260206004820152601660248201527f4e6f7420656e6f756768204c494e4b20746f20726e67000000000000000000006044820152606401610252565b6109f8600554600654610ac7565b905090565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008281526008602090815260408083205480845260079092529091205480610a9f5760408051602080820183528582526000858152600790915291909120610a99916001610c41565b50610ac1565b6000828152600760209081526040822080546001810182559083529120018390555b50505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001610b37929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610b6493929190610dc4565b6020604051808303816000875af1158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba79190610d25565b5060008381526020818152604080832054815180840188905280830185905230606082015260808082018390528351808303909101815260a090910190925281519183019190912086845292909152610c01906001610dac565b6000858152602081815260409182902092909255805180830187905280820184905281518082038301815260609091019091528051910120949350505050565b828054828255906000526020600020908101928215610c7c579160200282015b82811115610c7c578251825591602001919060010190610c61565b50610c88929150610c8c565b5090565b5b80821115610c885760008155600101610c8d565b600060208284031215610cb357600080fd5b81356001600160a01b0381168114610cca57600080fd5b9392505050565b60008060408385031215610ce457600080fd5b50508035926020909101359150565b600060208284031215610d0557600080fd5b5035919050565b600060208284031215610d1e57600080fd5b5051919050565b600060208284031215610d3757600080fd5b81518015158114610cca57600080fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610d6f57610d6f610d47565b500390565b634e487b7160e01b600052603260045260246000fd5b600082610da757634e487b7160e01b600052601260045260246000fd5b500690565b60008219821115610dbf57610dbf610d47565b500190565b6001600160a01b038416815260006020848184015260606040840152835180606085015260005b81811015610e0757858101830151858201608001528201610deb565b81811115610e19576000608083870101525b50601f01601f1916929092016080019594505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122053ea6ebae86fd9a00ef8ca5d37066b45d8562bec00866e31e4303001f776f6ed64736f6c634300080a0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.