Address Contract Partially Verified
Address
0x19112AdBDAfB465ddF0b57eCC07E68110Ad09c50
Balance
0 ETH
Nonce
29
Code Size
6118 bytes
Creator
Create2 Deployer at tx 0x0fab1064...a5579e
Indexed Transactions
0
Contract Bytecode
6118 bytes
0x60806040526004361015610012575b5f80fd5b5f3560e01c8063305fa0dd14610590578063679d11971461053e578063715018a61461049057806379ba50971461039c57806386b85f7b1461034a5780638935f667146101975780638da5cb5b1461015d578063e30c3978146101225763f2fde38b0361000e573461011e57602060031936011261011a5773ffffffffffffffffffffffffffffffffffffffff6100a761062c565b6100af6107b9565b16807fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015573ffffffffffffffffffffffffffffffffffffffff5f54167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a35f80f35b5f80fd5b5f80fd5b34610159575f60031936011261015557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b5f80fd5b5f80fd5b34610193575f60031936011261018f57602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b5f80fd5b5f80fd5b346103465760806003193601126103425760043567ffffffffffffffff811161033e576101c89036906004016106a3565b60243567ffffffffffffffff811161033a576101e89036906004016106a3565b60443560643573ffffffffffffffffffffffffffffffffffffffff81168103610336576040516020810190610232816102248587898b88610753565b03601f198101835282610653565b5190209160405191610fe0908184019284841067ffffffffffffffff8511176103095786888695610267956108068839610753565b03905ff59182156102fe576102d16102cb73ffffffffffffffffffffffffffffffffffffffff6020951692835f526002865260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905561079d565b9261079d565b60405192827fee0ac213f2019bb3a045e35f4817f0603ff7723efdc03f2e4f4063dcc2d280a65f80a48152f35b6040513d5f823e3d90fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b346103985760206003193601126103945773ffffffffffffffffffffffffffffffffffffffff61037861062c565b165f526003602052602060ff60405f2054166040519015158152f35b5f80fd5b5f80fd5b3461048c575f600319360112610488573373ffffffffffffffffffffffffffffffffffffffff600154160361045c577fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f54337fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f5573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35f80f35b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b5f80fd5b5f80fd5b3461053a575f600319360112610536576104a86107b9565b7fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35f80f35b5f80fd5b5f80fd5b3461058c5760206003193601126105885773ffffffffffffffffffffffffffffffffffffffff61056c61062c565b165f526002602052602060ff60405f2054166040519015158152f35b5f80fd5b5f80fd5b346106285760206003193601126106245773ffffffffffffffffffffffffffffffffffffffff6105be61062c565b6105c66107b9565b16805f52600360205260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f3a4401745b935c33cf0024a7b4ba087fa3dc5666616aa45d769305ddd25ac9905f80a25f80f35b5f80fd5b5f80fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361064f57565b5f80fd5b90601f601f19910116810190811067ffffffffffffffff82111761067657604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b81601f8201121561072a5780359067ffffffffffffffff82116106fd57604051926106d86020601f19601f8601160185610653565b828452602083830101116106f957815f926020809301838601378301015290565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f80fd5b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b92949361079160609361078373ffffffffffffffffffffffffffffffffffffffff9460808852608088019061072e565b90868203602088015261072e565b95604085015216910152565b602090604051918183925191829101835e81015f815203902090565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107d957565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffdfe60a0604052346103ad57610fe080380380610019816103b1565b9283398101906080818303126103a957805160018060401b0381116103a557826100449183016103e9565b9160208201519060018060401b0382116103a1576100639183016103e9565b906060604082015191015160018060a01b03811680910361039d57801561038a5760018060a01b0319600154166001555f548160018060a01b03198216175f5560018060a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3825160018060401b03811161037657600354600181811c9116801561036c575b602082101461035857601f811161030e575b506020601f82116001146102ab57819293945f9261029f575b50508160011b915f199060031b1c1916176003555b815160018060401b03811161028b57600454600181811c91168015610281575b602082101461026d57601f8111610223575b50602092601f82116001146101c257928192935f926101b6575b50508160011b915f199060031b1c1916176004555b60055533608052604051610b8a90816104568239608051818181610637015261091f0152f35b90915001515f8061017b565b601f1982169360045f52805f20915f5b86811061020b57508360019596106101f3575b505050811b01600455610190565b01515f1960f88460031b161c191690555f80806101e5565b919260206001819286850151815501940192016101d2565b60045f5260205f20601f830160051c81019160208410610260575b601f0160051c01905b8181106102545750610161565b805f6001925501610247565b9150601f8192905061023e565b634e487b7160e01b5f52602260045260245ffd5b90607f169061014f565b634e487b7160e01b5f52604160045260245ffd5b90915001515f8061011a565b601f1982169060035f52805f20915f5b8181106102f6575095836001959697106102de575b505050811b0160035561012f565b01515f1960f88460031b161c191690555f80806102d0565b9192602060018192868b0151815501940192016102bb565b60035f5260205f20601f830160051c8101916020841061034b575b601f0160051c01905b81811061033f5750610101565b805f6001925501610332565b9150601f81929050610329565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100ef565b634e487b7160e01b5f52604160045260245ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b9060405191601f8019910116820182811060018060401b038211176103d557604052565b634e487b7160e01b5f52604160045260245ffd5b81601f820112156104515780519060018060401b03821161043d576104176020601f19601f850116016103b1565b928284526020838301011161043957815f9260208093018386015e8301015290565b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f80fdfe60806040526004361015610012575b5f80fd5b5f3560e01c806306fdde031461094b5780631281cd00146108f3578063313ce567146108ce5780635d8a776e1461082c57806361431aa7146107725780636b1b863a146105b3578063715018a61461050557806379ba5097146104115780638da5cb5b146103d757806395d89b41146102c1578063aa78e8e714610243578063e30c397814610208578063e91929b6146101b6578063f2fde38b1461010d5763fd8120940361000e57346101095760206003193601126101055773ffffffffffffffffffffffffffffffffffffffff6100e9610b17565b165f526002602052602060ff60405f2054166040519015158152f35b5f80fd5b5f80fd5b346101b25760206003193601126101ae5773ffffffffffffffffffffffffffffffffffffffff61013b610b17565b610143610b3e565b16807fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015573ffffffffffffffffffffffffffffffffffffffff5f54167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a35f80f35b5f80fd5b5f80fd5b346102045760206003193601126102005773ffffffffffffffffffffffffffffffffffffffff6101e4610b17565b165f526006602052602060ff60405f2054166040519015158152f35b5f80fd5b5f80fd5b3461023f575f60031936011261023b57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b5f80fd5b5f80fd5b346102bd5760206003193601126102b95773ffffffffffffffffffffffffffffffffffffffff610271610b17565b610279610b3e565b16805f52600660205260405f20600160ff198254161790557f3ce54984081b7618e09cb43bc549621b6f38e3633b7188e1b2112263253b49515f80a25f80f35b5f80fd5b5f80fd5b346103d3575f6003193601126103cf576040515f6004548060011c906001811680156103c5575b6020831081146103985782855290815f1461036f5750600114610326575b6103228361031681850382610a61565b60405191829182610acf565b0390f35b91905060045f5260205f20915f905b808210610355575061032292508160206103169282010192509250610306565b919260018160209254838588010152019101909291610335565b8493506103229491506103169260ff196020921682840152151560051b82010192509250610306565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f16916102e8565b5f80fd5b5f80fd5b3461040d575f60031936011261040957602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b5f80fd5b5f80fd5b34610501575f6003193601126104fd573373ffffffffffffffffffffffffffffffffffffffff60015416036104d1577fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f54337fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f5573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35f80f35b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b5f80fd5b5f80fd5b346105af575f6003193601126105ab5761051d610b3e565b7fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35f80f35b5f80fd5b5f80fd5b3461076e57606060031936011261076a576105cc610b17565b6044359073ffffffffffffffffffffffffffffffffffffffff8216809203610766576040517f86b85f7b00000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa90811561075b575f91610714575b50156106ec57815f52600660205260ff60405f205416156106c45773ffffffffffffffffffffffffffffffffffffffff60243591167f81801b6b83e2291640c8b02c542338ac0eb78f20ae744f5f6bc133ce05c7533e5f80a45f80f35b7fed930d8e000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f72ec6b0e000000000000000000000000000000000000000000000000000000005f5260045ffd5b90506020813d60201161074f575b8161072f60209383610a61565b8101031261074b575180151581036107475783610667565b5f80fd5b5f80fd5b602091503d9150610722565b6040513d5f823e3d90fd5b5f80fd5b5f80fd5b5f80fd5b346108285760206003193601126108245773ffffffffffffffffffffffffffffffffffffffff6107a0610b17565b6107a8610b3e565b16805f52600260205260ff60405f2054166107fc57805f52600260205260405f20600160ff198254161790557fb3e26d618f04f483341e0e23ab7271b024bab7206db1a5b04c1dcec0e63d2fc65f80a25f80f35b7f41503376000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f80fd5b5f80fd5b346108ca5760406003193601126108c657610845610b17565b335f52600260205260ff60405f2054161561089e57339073ffffffffffffffffffffffffffffffffffffffff60243591167f81801b6b83e2291640c8b02c542338ac0eb78f20ae744f5f6bc133ce05c7533e5f80a45f80f35b7f568b9113000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f80fd5b5f80fd5b346108ef575f6003193601126108eb576020600554604051908152f35b5f80fd5b5f80fd5b34610947575f60031936011261094357602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b5f80fd5b34610a5d575f600319360112610a59576040515f6003548060011c90600181168015610a4f575b602083108114610a225782855290815f146109f957506001146109b0575b6109ac836109a081850382610a61565b60405191829182610acf565b0390f35b91905060035f5260205f20915f905b8082106109df57506109ac92508160206109a09282010192509250610990565b9192600181602092548385880101520191019092916109bf565b8493506109ac9491506109a09260ff196020921682840152151560051b82010192509250610990565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691610972565b5f80fd5b5f80fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610aa257604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602060409481855280519182918282880152018686015e5f8582860101520116010190565b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610b3a57565b5f80fd5b73ffffffffffffffffffffffffffffffffffffffff5f54163303610b5e57565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd
Verified Source Code Partial Match
Compiler: v0.8.27+commit.40a35a09
EVM: cancun
PointsFactory.sol 43 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import { Points } from "src/Points.sol";
import { Ownable2Step, Ownable } from "lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol";
/// @title PointsFactory
/// @author CopyPaste, corddry, ShivaanshK
/// @dev A simple factory for creating Points Programs
contract PointsFactory is Ownable2Step {
/// @notice Mapping of Points Program address => bool (indicator of if Points Program was deployed using this factory)
mapping(address => bool) public isPointsProgram;
/// @notice Mapping of RecipeMarketHub address => bool (indicator of if the address is of a Royco RecipeMarketHub)
mapping(address => bool) public isRecipeMarketHub;
/// @notice Emitted when creating a points program using this factory
event NewPointsProgram(Points indexed points, string indexed name, string indexed symbol);
/// @notice Emitted when adding an RecipeMarketHub to this Points Factory
event RecipeMarketHubAdded(address indexed recipeMarketHub);
/// @param _owner The owner of the points factory - responsible for adding valid RecipeMarketHub(s) to the PointsFactory
constructor(address _owner) Ownable(_owner) { }
/// @param _recipeMarketHub The RecipeMarketHub to mark as valid in the Points Factory
function addRecipeMarketHub(address _recipeMarketHub) external onlyOwner {
isRecipeMarketHub[_recipeMarketHub] = true;
emit RecipeMarketHubAdded(_recipeMarketHub);
}
/// @param _name The name for the new points program
/// @param _symbol The symbol for the new points program
/// @param _decimals The amount of decimals per point
/// @param _owner The owner of the new points program
function createPointsProgram(string memory _name, string memory _symbol, uint256 _decimals, address _owner) external returns (Points points) {
bytes32 salt = keccak256(abi.encode(_name, _symbol, _decimals, _owner));
points = new Points{ salt: salt }(_name, _symbol, _decimals, _owner);
isPointsProgram[address(points)] = true;
emit NewPointsProgram(points, _name, _symbol);
}
}
Points.sol 114 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import { PointsFactory } from "src/PointsFactory.sol";
import { Ownable2Step, Ownable } from "lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol";
/// @title Points
/// @author CopyPaste, corddry, ShivaanshK
/// @dev A simple contract for running Points Programs
contract Points is Ownable2Step {
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
/// @param _name The name of the points program
/// @param _symbol The symbol for the points program
/// @param _decimals The amount of decimals to use for accounting with points
/// @param _owner The owner of the points program
constructor(string memory _name, string memory _symbol, uint256 _decimals, address _owner) Ownable(_owner) {
name = _name;
symbol = _symbol;
decimals = _decimals;
// Enforces that the Points Program deployer is a factory
pointsFactory = PointsFactory(msg.sender);
}
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Award(address indexed to, uint256 indexed amount, address indexed awardedBy);
event AllowedVaultAdded(address indexed vault);
event AllowedIPAdded(address indexed ip);
event VaultRemoved(address indexed vault);
/*//////////////////////////////////////////////////////////////
STORAGE
//////////////////////////////////////////////////////////////*/
/// @dev Maps a vault to if the vault is allowed to call this contract
mapping(address => bool) public isAllowedVault;
/// @dev The PointsFactory used to create this program
PointsFactory public immutable pointsFactory;
/// @dev The name of the points program
string public name;
/// @dev The symbol for the points program
string public symbol;
/// @dev We track all points logic using base 1
uint256 public decimals;
/// @dev Track which RecipeMarketHub IPs are allowed to mint
mapping(address => bool) public allowedIPs;
/*//////////////////////////////////////////////////////////////
POINTS AUTH
//////////////////////////////////////////////////////////////*/
error VaultIsDuplicate();
/// @param vault The address to add to the allowed vaults for the points program
function addAllowedVault(address vault) external onlyOwner {
if (isAllowedVault[vault]) {
revert VaultIsDuplicate();
}
isAllowedVault[vault] = true;
emit AllowedVaultAdded(vault);
}
/// @param ip The incentive provider address to allow to mint points on RecipeMarketHub
function addAllowedIP(address ip) external onlyOwner {
allowedIPs[ip] = true;
emit AllowedIPAdded(ip);
}
error OnlyAllowedVaults();
error OnlyRecipeMarketHub();
error NotAllowedIP();
modifier onlyAllowedVaults() {
if (!isAllowedVault[msg.sender]) {
revert OnlyAllowedVaults();
}
_;
}
/// @dev only the RecipeMarketHub can call this function
/// @param ip The address to check if allowed
modifier onlyRecipeMarketHubAllowedIP(address ip) {
if (!pointsFactory.isRecipeMarketHub(msg.sender)) {
revert OnlyRecipeMarketHub();
}
if (!allowedIPs[ip]) {
revert NotAllowedIP();
}
_;
}
/*//////////////////////////////////////////////////////////////
POINTS
//////////////////////////////////////////////////////////////*/
/// @param to The address to mint points to
/// @param amount The amount of points to award to the `to` address
function award(address to, uint256 amount) external onlyAllowedVaults {
emit Award(to, amount, msg.sender);
}
/// @param to The address to mint points to
/// @param amount The amount of points to award to the `to` address
/// @param ip The incentive provider attempting to mint the points
function award(address to, uint256 amount, address ip) external onlyRecipeMarketHubAllowedIP(ip) {
emit Award(to, amount, ip);
}
}
Ownable2Step.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Read Contract
isPointsProgram 0x679d1197 → bool
isRecipeMarketHub 0x86b85f7b → bool
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
addRecipeMarketHub 0x305fa0dd
address _recipeMarketHub
createPointsProgram 0x8935f667
string _name
string _symbol
uint256 _decimals
address _owner
returns: address
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address