Address Details
contract

0x627fFE1f36F4c7a8241Ed89758a542b7d2412877

Contract Name
RewardsDistributor
Creator
0x4a9797–0cfb8b at 0xdefa09–8b14e8
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
13 Transactions
Transfers
0 Transfers
Gas Used
762,365
Last Balance Update
15362076
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
RewardsDistributor




Optimization enabled
true
Compiler version
v0.8.13+commit.abaa5c0e




Optimization runs
999999
EVM Version
london




Verified at
2022-09-19T20:23:07.020283Z

contracts/RewardsDistributor.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./rewardModules/IRewardModule.sol";

contract RewardsDistributor is Ownable {
    bytes32 public immutable REWARD_TYPEHASH =
        keccak256(
            "Reward(address beneficiary,string campaignId,string rewardId)"
        );
    bytes32 public immutable DOMAIN_SEPARATOR =
        keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                ),
                keccak256(bytes("Reward")),
                keccak256(bytes("1")),
                42220, // Celo mainnet
                address(this)
            )
        );

    struct Campaign {
        bool isActive;
        address rewardModule;
        address eligibilityModule;
    }

    event RewardSent(
        address indexed beneficiary,
        string indexed campaignId,
        string indexed rewardId
    );

    // campaignId => Campaign
    mapping(string => Campaign) public campaigns;
    // campaignId => rewardId => isRewardClaimed
    mapping(string => mapping(string => bool)) public claimedRewards;

    function claimReward(
        address beneficiary,
        string memory campaignId,
        string memory rewardId,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        Campaign storage campaign = campaigns[campaignId];
        require(campaign.isActive, "RD: Campaign is not active");
        require(
            !claimedRewards[campaignId][rewardId],
            "RD: Reward already claimed"
        );
        claimedRewards[campaignId][rewardId] = true;

        bytes32 hashStruct = keccak256(
            abi.encode(
                REWARD_TYPEHASH,
                beneficiary,
                keccak256(bytes(campaignId)),
                keccak256(bytes(rewardId))
            )
        );
        bytes32 digest = keccak256(
            abi.encodePacked(uint16(0x1901), DOMAIN_SEPARATOR, hashStruct)
        );

        address signer = ecrecover(digest, v, r, s);
        require(signer == campaign.eligibilityModule, "RD: Invalid signature");

        IRewardModule(campaign.rewardModule).sendReward(beneficiary);

        emit RewardSent(beneficiary, campaignId, rewardId);
    }

    function setCampaign(
        string memory campaignId,
        address rewardModule,
        address eligibilityModule
    ) external onlyOwner {
        campaigns[campaignId] = Campaign(true, rewardModule, eligibilityModule);
    }

    function setIsCampaignActive(string memory campaignId, bool isActive)
        external
        onlyOwner
    {
        campaigns[campaignId].isActive = isActive;
    }

    // VIEW FUNCTIONS

    function isRewardClaimed(string memory campaignId, string memory rewardId)
        external
        view
        returns (bool)
    {
        return claimedRewards[campaignId][rewardId];
    }
}
        

/_openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 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 {
        _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);
    }
}
          

/_openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}
          

/_openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}
          

/_openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}
          

/_openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}
          

/_openzeppelin/contracts/utils/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;
    }
}
          

/contracts/rewardModules/IRewardModule.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

interface IRewardModule {
    function sendReward(address userAddress) external;
}
          

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":"event","name":"RewardSent","inputs":[{"type":"address","name":"beneficiary","internalType":"address","indexed":true},{"type":"string","name":"campaignId","internalType":"string","indexed":true},{"type":"string","name":"rewardId","internalType":"string","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DOMAIN_SEPARATOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"REWARD_TYPEHASH","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"isActive","internalType":"bool"},{"type":"address","name":"rewardModule","internalType":"address"},{"type":"address","name":"eligibilityModule","internalType":"address"}],"name":"campaigns","inputs":[{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimReward","inputs":[{"type":"address","name":"beneficiary","internalType":"address"},{"type":"string","name":"campaignId","internalType":"string"},{"type":"string","name":"rewardId","internalType":"string"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"claimedRewards","inputs":[{"type":"string","name":"","internalType":"string"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRewardClaimed","inputs":[{"type":"string","name":"campaignId","internalType":"string"},{"type":"string","name":"rewardId","internalType":"string"}]},{"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":"setCampaign","inputs":[{"type":"string","name":"campaignId","internalType":"string"},{"type":"address","name":"rewardModule","internalType":"address"},{"type":"address","name":"eligibilityModule","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIsCampaignActive","inputs":[{"type":"string","name":"campaignId","internalType":"string"},{"type":"bool","name":"isActive","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x60c0806040523461012a5760008054336001600160a01b0319821681178355926001600160a01b03909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a37fc877dffa5a35fe1541c02cabf76f05f7c26c1cf459b9a3ac39e915335f81ecd560805261007a610183565b602081519101206100e76100f561008f6101a5565b8051602091820120604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f93810193845290810195909552606085015261a4ec60808501523060a08501529291829060c0820190565b03601f198101835282610160565b51902060a052604051610fb190816101c382396080518181816109f60152610ce3015260a0518181816104a10152610d7f0152f35b600080fd5b604081019081106001600160401b0382111761014a57604052565b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b0382119082101761014a57604052565b604051906101908261012f565b600682526514995dd85c9960d21b6020830152565b604051906101b28261012f565b60018252603160f81b602083015256fe60806040526004361015610013575b600080fd5b60003560e01c80631ab3683d146100ef5780631d39e509146100e65780633644e515146100dd5780634fc14682146100d45780636671a01a146100cb578063715018a6146100c25780638da5cb5b146100b9578063a19ed93d146100b0578063b2e28b9b146100a7578063f2fde38b1461009e5763fb01e4e11461009657600080fd5b61000e6109bf565b5061000e6108cf565b5061000e6108a9565b5061000e610726565b5061000e6106d3565b5061000e61062b565b5061000e6105e9565b5061000e6104c4565b5061000e61046a565b5061000e6103b7565b5061000e610292565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176101ad57604052565b6101b5610161565b604052565b67ffffffffffffffff81116101ad57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176101ad57604052565b81601f8201121561000e5780359067ffffffffffffffff8211610285575b6040519261026360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601856101ce565b8284526020838301011161000e57816000926020809301838601378301015290565b61028d610161565b61022d565b503461000e5760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e576102ca6100f8565b67ffffffffffffffff60243581811161000e576102eb90369060040161020f565b9060443590811161000e5761030490369060040161020f565b9160643560ff8116810361000e576103239360a4359360843593610c3f565b005b90815180926000905b82821061034957501161033f570190565b6000828201520190565b91508060208092840101518185015201839161032e565b60206103729160405192838092610325565b600281520301902090565b602061038f9160405192838092610325565b600181520301902090565b6020906103ad9260405193848093610325565b9081520301902090565b503461000e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761041a602061040e606093369060040161020f565b60405192838092610325565b6001815203019020600181549173ffffffffffffffffffffffffffffffffffffffff918291015416906040519260ff81161515845260081c1660208301526040820152f35b600091031261000e57565b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461000e5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761051490369060040161020f565b602435801515810361000e5761054c60206103239361040e73ffffffffffffffffffffffffffffffffffffffff600054163314610a19565b60018152030190209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261000e5767ffffffffffffffff60043581811161000e57836105cf9160040161020f565b9260243591821161000e576105e69160040161020f565b90565b503461000e57602060ff61061f8261061161060336610584565b929060405192838092610325565b60028152030190209061039a565b54166040519015158152f35b503461000e576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106d05780547fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff8216916106a2338414610a19565b16825581604051917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08284a3f35b80fd5b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e57602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b503461000e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761077961032391369060040161020f565b600161078361011b565b61078b61013e565b73ffffffffffffffffffffffffffffffffffffffff916107b083600054163314610a19565b6108216107e56020604051976107c589610191565b87895286828a01951685528660408a019616865260405192838092610325565b8881520301902095511515869060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b517fffffffffffffffffffffff0000000000000000000000000000000000000000ff74ffffffffffffffffffffffffffffffffffffffff0086549260081b169116178455511691019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b503461000e57602060ff61061f6108c96108c236610584565b9190610360565b9061039a565b503461000e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e576109076100f8565b73ffffffffffffffffffffffffffffffffffffffff61092b81600054163314610a19565b81161561093b5761032390610a7e565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b15610a2057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6000549073ffffffffffffffffffffffffffffffffffffffff80911691827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06000604051a3565b15610af457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52443a2043616d706169676e206973206e6f74206163746976650000000000006044820152fd5b15610b5957565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52443a2052657761726420616c726561647920636c61696d65640000000000006044820152fd5b506040513d6000823e3d90fd5b15610bcb57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f52443a20496e76616c6964207369676e617475726500000000000000000000006044820152fd5b610c399060405191828092610325565b03902090565b94610e05602091959395610c528461037d565b94610c66610c61875460ff1690565b610aed565b610c91610c8c610c88610c81610c7b89610360565b8c61039a565b5460ff1690565b1590565b610b52565b610cd1610ca6610ca087610360565b8a61039a565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b845184860120885189860120604080517f000000000000000000000000000000000000000000000000000000000000000081890190815273ffffffffffffffffffffffffffffffffffffffff8e16602082015291820193909352606081019190915281608082010391610d6a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938481018352826101ce565b51902090610de16040519182610dd5898201957f00000000000000000000000000000000000000000000000000000000000000008790916042927f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201520190565b039081018352826101ce565b5190206040805191825260ff90981660208201529687015260608601526080850190565b846000958692838052039060015afa15610f6e575b610ea1610e4d610e4d855194610e84610e66610e4d600184015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff80981614610bc4565b5460081c73ffffffffffffffffffffffffffffffffffffffff1690565b803b15610f6a576040517f9dabff2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff871660048201527f208dead2d6510ed1463bf68b480abfb80344be6523ab4a3fc8df8780c5d11d729392610f3b92610f35929087908290602490829084905af18015610f5d575b610f44575b50610c29565b94610c29565b941691604051a4565b80610f51610f57926101ba565b8061045f565b38610f2f565b610f65610bb7565b610f2a565b8380fd5b610f76610bb7565b610e1a56fea26469706673582212200aa3bba2044b882c36e41fd0962fbef52cf8868cc4d201d16887d09d8608abe264736f6c634300080d0033

Deployed ByteCode

0x60806040526004361015610013575b600080fd5b60003560e01c80631ab3683d146100ef5780631d39e509146100e65780633644e515146100dd5780634fc14682146100d45780636671a01a146100cb578063715018a6146100c25780638da5cb5b146100b9578063a19ed93d146100b0578063b2e28b9b146100a7578063f2fde38b1461009e5763fb01e4e11461009657600080fd5b61000e6109bf565b5061000e6108cf565b5061000e6108a9565b5061000e610726565b5061000e6106d3565b5061000e61062b565b5061000e6105e9565b5061000e6104c4565b5061000e61046a565b5061000e6103b7565b5061000e610292565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361000e57565b507f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176101ad57604052565b6101b5610161565b604052565b67ffffffffffffffff81116101ad57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176101ad57604052565b81601f8201121561000e5780359067ffffffffffffffff8211610285575b6040519261026360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601856101ce565b8284526020838301011161000e57816000926020809301838601378301015290565b61028d610161565b61022d565b503461000e5760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e576102ca6100f8565b67ffffffffffffffff60243581811161000e576102eb90369060040161020f565b9060443590811161000e5761030490369060040161020f565b9160643560ff8116810361000e576103239360a4359360843593610c3f565b005b90815180926000905b82821061034957501161033f570190565b6000828201520190565b91508060208092840101518185015201839161032e565b60206103729160405192838092610325565b600281520301902090565b602061038f9160405192838092610325565b600181520301902090565b6020906103ad9260405193848093610325565b9081520301902090565b503461000e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761041a602061040e606093369060040161020f565b60405192838092610325565b6001815203019020600181549173ffffffffffffffffffffffffffffffffffffffff918291015416906040519260ff81161515845260081c1660208301526040820152f35b600091031261000e57565b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760206040517fd6681133955303b964564e644e1461ad7ca93e34461c8e2499828be668f7770a8152f35b503461000e5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761051490369060040161020f565b602435801515810361000e5761054c60206103239361040e73ffffffffffffffffffffffffffffffffffffffff600054163314610a19565b60018152030190209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b9060407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261000e5767ffffffffffffffff60043581811161000e57836105cf9160040161020f565b9260243591821161000e576105e69160040161020f565b90565b503461000e57602060ff61061f8261061161060336610584565b929060405192838092610325565b60028152030190209061039a565b54166040519015158152f35b503461000e576000807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106d05780547fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff8216916106a2338414610a19565b16825581604051917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08284a3f35b80fd5b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e57602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b503461000e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760043567ffffffffffffffff811161000e5761077961032391369060040161020f565b600161078361011b565b61078b61013e565b73ffffffffffffffffffffffffffffffffffffffff916107b083600054163314610a19565b6108216107e56020604051976107c589610191565b87895286828a01951685528660408a019616865260405192838092610325565b8881520301902095511515869060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b517fffffffffffffffffffffff0000000000000000000000000000000000000000ff74ffffffffffffffffffffffffffffffffffffffff0086549260081b169116178455511691019073ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055565b503461000e57602060ff61061f6108c96108c236610584565b9190610360565b9061039a565b503461000e5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e576109076100f8565b73ffffffffffffffffffffffffffffffffffffffff61092b81600054163314610a19565b81161561093b5761032390610a7e565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b503461000e5760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261000e5760206040517fc877dffa5a35fe1541c02cabf76f05f7c26c1cf459b9a3ac39e915335f81ecd58152f35b15610a2057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6000549073ffffffffffffffffffffffffffffffffffffffff80911691827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06000604051a3565b15610af457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52443a2043616d706169676e206973206e6f74206163746976650000000000006044820152fd5b15610b5957565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f52443a2052657761726420616c726561647920636c61696d65640000000000006044820152fd5b506040513d6000823e3d90fd5b15610bcb57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f52443a20496e76616c6964207369676e617475726500000000000000000000006044820152fd5b610c399060405191828092610325565b03902090565b94610e05602091959395610c528461037d565b94610c66610c61875460ff1690565b610aed565b610c91610c8c610c88610c81610c7b89610360565b8c61039a565b5460ff1690565b1590565b610b52565b610cd1610ca6610ca087610360565b8a61039a565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055565b845184860120885189860120604080517fc877dffa5a35fe1541c02cabf76f05f7c26c1cf459b9a3ac39e915335f81ecd581890190815273ffffffffffffffffffffffffffffffffffffffff8e16602082015291820193909352606081019190915281608082010391610d6a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938481018352826101ce565b51902090610de16040519182610dd5898201957fd6681133955303b964564e644e1461ad7ca93e34461c8e2499828be668f7770a8790916042927f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201520190565b039081018352826101ce565b5190206040805191825260ff90981660208201529687015260608601526080850190565b846000958692838052039060015afa15610f6e575b610ea1610e4d610e4d855194610e84610e66610e4d600184015473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff80981614610bc4565b5460081c73ffffffffffffffffffffffffffffffffffffffff1690565b803b15610f6a576040517f9dabff2500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff871660048201527f208dead2d6510ed1463bf68b480abfb80344be6523ab4a3fc8df8780c5d11d729392610f3b92610f35929087908290602490829084905af18015610f5d575b610f44575b50610c29565b94610c29565b941691604051a4565b80610f51610f57926101ba565b8061045f565b38610f2f565b610f65610bb7565b610f2a565b8380fd5b610f76610bb7565b610e1a56fea26469706673582212200aa3bba2044b882c36e41fd0962fbef52cf8868cc4d201d16887d09d8608abe264736f6c634300080d0033