Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- OracleNFTWeight
- Optimization enabled
- true
- Compiler version
- v0.8.16+commit.07a7930e
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2022-10-28T01:43:51.177841Z
Contract source code
// File @openzeppelin/contracts/utils/[email protected] // 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; } } // File @openzeppelin/contracts/access/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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 contracts/OracleNFTWeight.sol pragma solidity ^0.8.9; contract OracleNFTWeight is Ownable { mapping(uint256 => uint256) public oracleNFTWeight; function setOracleNFTWeight(uint256 _tokenId, uint256 _weight) external onlyOwner { oracleNFTWeight[_tokenId] = _weight; } }
Contract ABI
[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"oracleNFTWeight","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracleNFTWeight","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_weight","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6102d18061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80636bbc355f1461005c578063715018a6146100715780638da5cb5b14610079578063c8fe2d3914610099578063f2fde38b146100c7575b600080fd5b61006f61006a366004610230565b6100da565b005b61006f6100f4565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100b96100a7366004610252565b60016020526000908152604090205481565b604051908152602001610090565b61006f6100d536600461026b565b610108565b6100e2610186565b60009182526001602052604090912055565b6100fc610186565b61010660006101e0565b565b610110610186565b6001600160a01b03811661017a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610183816101e0565b50565b6000546001600160a01b031633146101065760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610171565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561024357600080fd5b50508035926020909101359150565b60006020828403121561026457600080fd5b5035919050565b60006020828403121561027d57600080fd5b81356001600160a01b038116811461029457600080fd5b939250505056fea264697066735822122058970ba5d20459ae2c5636f8f07b8c00e45021fe6ff050da915141592cdd021864736f6c63430008100033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c80636bbc355f1461005c578063715018a6146100715780638da5cb5b14610079578063c8fe2d3914610099578063f2fde38b146100c7575b600080fd5b61006f61006a366004610230565b6100da565b005b61006f6100f4565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100b96100a7366004610252565b60016020526000908152604090205481565b604051908152602001610090565b61006f6100d536600461026b565b610108565b6100e2610186565b60009182526001602052604090912055565b6100fc610186565b61010660006101e0565b565b610110610186565b6001600160a01b03811661017a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610183816101e0565b50565b6000546001600160a01b031633146101065760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610171565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561024357600080fd5b50508035926020909101359150565b60006020828403121561026457600080fd5b5035919050565b60006020828403121561027d57600080fd5b81356001600160a01b038116811461029457600080fd5b939250505056fea264697066735822122058970ba5d20459ae2c5636f8f07b8c00e45021fe6ff050da915141592cdd021864736f6c63430008100033