More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Sbt | 53097202 | 302 days ago | IN | 0 POL | 0.00162525 |
Loading...
Loading
Contract Name:
TicketAward
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/access/Ownable.sol"; contract TicketAward is Ownable { address private _sbt; uint256 public _multiplierAlpha = 100; constructor() {} modifier onlySbt() { require(msg.sender == _sbt, "Only callable by the SBT contract"); _; } // MARK: - Only Owner function setMultiplierAlpha(uint256 alpha) external onlyOwner { _multiplierAlpha = alpha; } function setSbt(address sbt) external onlyOwner { _sbt = sbt; } // MARK: - Only SBT function calculateAward(uint256 amount, uint8 level) external view onlySbt returns (uint256) { return level + (_multiplierAlpha * amount * level / 100) - (_multiplierAlpha * level / 100); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) 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() { _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); } }
// 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; } }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/", "@semanticSBT/=lib/semanticSBT/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "semanticSBT/=lib/semanticSBT/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"_multiplierAlpha","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint8","name":"level","type":"uint8"}],"name":"calculateAward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"alpha","type":"uint256"}],"name":"setMultiplierAlpha","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sbt","type":"address"}],"name":"setSbt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052606460025534801561001557600080fd5b5061001f33610024565b610074565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610478806100836000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100b2578063a5560206146100d2578063aabf5657146100f3578063f2fde38b146100fc57600080fd5b8063228dc3601461008257806352b9b98514610097578063715018a6146100aa575b600080fd5b61009561009036600461034e565b61010f565b005b6100956100a536600461037e565b610139565b610095610146565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100e56100e0366004610397565b61015a565b6040519081526020016100c9565b6100e560025481565b61009561010a36600461034e565b61022b565b6101176102a4565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6101416102a4565b600255565b61014e6102a4565b61015860006102fe565b565b6001546000906001600160a01b031633146101c65760405162461bcd60e51b815260206004820152602160248201527f4f6e6c792063616c6c61626c65206279207468652053425420636f6e747261636044820152601d60fa1b60648201526084015b60405180910390fd5b60648260ff166002546101d991906103e3565b6101e391906103fa565b60648360ff16856002546101f791906103e3565b61020191906103e3565b61020b91906103fa565b6102189060ff851661041c565b610222919061042f565b90505b92915050565b6102336102a4565b6001600160a01b0381166102985760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101bd565b6102a1816102fe565b50565b6000546001600160a01b031633146101585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101bd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561036057600080fd5b81356001600160a01b038116811461037757600080fd5b9392505050565b60006020828403121561039057600080fd5b5035919050565b600080604083850312156103aa57600080fd5b82359150602083013560ff811681146103c257600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610225576102256103cd565b60008261041757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610225576102256103cd565b81810381811115610225576102256103cd56fea2646970667358221220799af94dd00b088020e64853cd364134abab87cb520acac08276b9cbb82915a464736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100b2578063a5560206146100d2578063aabf5657146100f3578063f2fde38b146100fc57600080fd5b8063228dc3601461008257806352b9b98514610097578063715018a6146100aa575b600080fd5b61009561009036600461034e565b61010f565b005b6100956100a536600461037e565b610139565b610095610146565b6000546040516001600160a01b0390911681526020015b60405180910390f35b6100e56100e0366004610397565b61015a565b6040519081526020016100c9565b6100e560025481565b61009561010a36600461034e565b61022b565b6101176102a4565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6101416102a4565b600255565b61014e6102a4565b61015860006102fe565b565b6001546000906001600160a01b031633146101c65760405162461bcd60e51b815260206004820152602160248201527f4f6e6c792063616c6c61626c65206279207468652053425420636f6e747261636044820152601d60fa1b60648201526084015b60405180910390fd5b60648260ff166002546101d991906103e3565b6101e391906103fa565b60648360ff16856002546101f791906103e3565b61020191906103e3565b61020b91906103fa565b6102189060ff851661041c565b610222919061042f565b90505b92915050565b6102336102a4565b6001600160a01b0381166102985760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101bd565b6102a1816102fe565b50565b6000546001600160a01b031633146101585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101bd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561036057600080fd5b81356001600160a01b038116811461037757600080fd5b9392505050565b60006020828403121561039057600080fd5b5035919050565b600080604083850312156103aa57600080fd5b82359150602083013560ff811681146103c257600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610225576102256103cd565b60008261041757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610225576102256103cd565b81810381811115610225576102256103cd56fea2646970667358221220799af94dd00b088020e64853cd364134abab87cb520acac08276b9cbb82915a464736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.