Address Contract Partially Verified
Address
0x6EfB3A913ba7685b167511f82A4cB72E758a74cb
Balance
0 ETH
Nonce
1
Code Size
3308 bytes
Creator
0xd2f6c381...88FF at tx 0xc4c46724...9a386a
Indexed Transactions
0
Contract Bytecode
3308 bytes
0x608060405234801561001057600080fd5b50600436106100a45760003560e01c80630a81c738146100a95780630a947351146100be578063379607f5146100d157806337b7b3aa146100e4578063635079561461010d578063715018a6146101225780638da5cb5b1461012a578063b293109614610144578063b918e5f914610182578063e0366ce914610195578063e13b54de146101a8578063f2fde38b1461020f575b600080fd5b6100bc6100b7366004610ad8565b610222565b005b6100bc6100cc366004610ad8565b6102d2565b6100bc6100df366004610afa565b61036e565b6100f76100f2366004610b28565b610456565b6040516101049190610b4c565b60405180910390f35b6101156104b7565b6040516101049190610b7f565b6100bc6106cf565b6000546001600160a01b03165b6040516101049190610bd4565b610172610152366004610be8565b600560209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610104565b600354610137906001600160a01b031681565b600254610137906001600160a01b031681565b6101e66101b6366004610afa565b6004602052600090815260409020805460018201546002830154600390930154919290916001600160a01b031684565b604080519485526020850193909352918301526001600160a01b03166060820152608001610104565b6100bc61021d366004610b28565b6106e3565b61022a61075e565b818015806102385750600381115b1561025657604051639e18a40160e01b815260040160405180910390fd5b681b1ae4d6e2ef5000008211156102805760405163843ce46b60e01b815260040160405180910390fd5b60008381526004602090815260409182902060028101859055915184815285917fc22e16deec6f587d0a1aad7275c1621e6c24431fea14dd71e8f3243e9fbc5ca391015b60405180910390a250505050565b6102da61075e565b818015806102e85750600381115b1561030657604051639e18a40160e01b815260040160405180910390fd5b60008381526004602052604090206001810154831015610339576040516339f5b40f60e11b815260040160405180910390fd5b82815560405183815284907fd3636070a5893c88088ab04180c3c0fe9be316dbea031e03a4aadbd688bf553a906020016102c4565b6103766107b8565b60025460405163022b92c360e21b81526000916001600160a01b0316906308ae4b0c906103a7903390600401610bd4565b606060405180830381865afa1580156103c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e89190610c14565b80519091506001600160a01b03166104135760405163089eb20560e21b815260040160405180910390fd5b818015806104215750600381115b1561043f57604051639e18a40160e01b815260040160405180910390fd5b61044883610812565b505061045360018055565b50565b61045e610a61565b6001600160a01b03919091166000908152600560209081526040808320600184528083528184205460ff908116151586526002855281845282852054811615158685015260038552925291829020541615159082015290565b6104bf610a7f565b60408051608080820183527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe055482527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe06546020838101919091527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe0754838501527fabd6e7cb50984ff9c2f3e18a2660c3353dadf4e3291deeb275dae2cd1e44fe08546001600160a01b03908116606080860191909152938652845180840186527f91da3fd0782e51c6b3986e9e672fd566868e71f3dbc2d6c2cd6fbb3e361af2a75481527f91da3fd0782e51c6b3986e9e672fd566868e71f3dbc2d6c2cd6fbb3e361af2a854818401527f91da3fd0782e51c6b3986e9e672fd566868e71f3dbc2d6c2cd6fbb3e361af2a954818701527f91da3fd0782e51c6b3986e9e672fd566868e71f3dbc2d6c2cd6fbb3e361af2aa5482168186015286830152600360005260048252845192830185527f2e174c10e159ea99b867ce3205125c24a42d128804e4070ed6fcc8cc98166aa05483527f2e174c10e159ea99b867ce3205125c24a42d128804e4070ed6fcc8cc98166aa154918301919091527f2e174c10e159ea99b867ce3205125c24a42d128804e4070ed6fcc8cc98166aa254828501527f2e174c10e159ea99b867ce3205125c24a42d128804e4070ed6fcc8cc98166aa35416918101919091529082015290565b6106d761075e565b6106e16000610a11565b565b6106eb61075e565b6001600160a01b0381166107555760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61045381610a11565b6000546001600160a01b031633146106e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161074c565b6002600154141561080b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161074c565b6002600155565b6000818152600460205260409020600281015461084257604051631e232a8760e31b815260040160405180910390fd5b33600090815260056020908152604080832085845290915290205460ff161561087e57604051630c8d9eab60e31b815260040160405180910390fd5b6000816002015482600101546108949190610c90565b82549091508111156108b957604051639e7a1c4f60e01b815260040160405180910390fd5b33600081815260056020908152604080832087845290915290819020805460ff19166001908117909155840183905560035460028501549151633e619d7d60e01b815260048101939093526024830186905260448301919091526001600160a01b031690633e619d7d90606401600060405180830381600087803b15801561094057600080fd5b505af1158015610954573d6000803e3d6000fd5b50505050600382015460028301546040516340c10f1960e01b815233600482015260248101919091526001600160a01b03909116906340c10f1990604401600060405180830381600087803b1580156109ac57600080fd5b505af11580156109c0573d6000803e3d6000fd5b5050505082336001600160a01b03167fd0755a9ef5a74f50d34b3503bb5b65ad71a112c001b76dfa6412c9aa4a1f43b08460020154604051610a0491815260200190565b60405180910390a3505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60405180606001604052806003906020820280368337509192915050565b60405180606001604052806003905b610ac2604051806080016040528060008152602001600081526020016000815260200160006001600160a01b031681525090565b815260200190600190039081610a8e5790505090565b60008060408385031215610aeb57600080fd5b50508035926020909101359150565b600060208284031215610b0c57600080fd5b5035919050565b6001600160a01b038116811461045357600080fd5b600060208284031215610b3a57600080fd5b8135610b4581610b13565b9392505050565b60608101818360005b6003811015610b765781511515835260209283019290910190600101610b55565b50505092915050565b6101808101818360005b6003811015610b765781518051845260208082015181860152604080830151908601526060918201516001600160a01b03169185019190915260809093019290910190600101610b89565b6001600160a01b0391909116815260200190565b60008060408385031215610bfb57600080fd5b8235610c0681610b13565b946020939093013593505050565b600060608284031215610c2657600080fd5b6040516060810181811067ffffffffffffffff82111715610c5757634e487b7160e01b600052604160045260246000fd5b6040528251610c6581610b13565b81526020838101519082015260408301518015158114610c8457600080fd5b60408201529392505050565b60008219821115610cb157634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220172ccdc83d9a9131f6a1f1026e25c5c652e297d18fb37f57911ad9eacd65235b64736f6c634300080c0033
Verified Source Code Partial Match
Compiler: v0.8.12+commit.f00d7308
EVM: istanbul
Optimization: Yes (50 runs)
Context.sol 24 lines
// 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;
}
}
IAccelerationProgram.sol 14 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "./IERC20.sol";
interface IAccelerationProgram is IERC20 {
function mint(address to, uint256 amount) external;
function burn(address from, uint256 amount) external;
function updateMintPermission(address from, bool state) external;
function updateBurnPermission(address from, bool state) external;
function transferOwnership(address newOwner) external;
}
IBarkDao.sol 15 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
interface IBarkDao {
struct Member {
address parent;
uint256 lastActionBlock;
bool hasTeam;
}
function highestParentAddress() external view returns (address);
function getLevel(address addr) external view returns (uint256);
function members(address addr) external view returns (Member memory);
}
IERC20.sol 82 lines
// 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);
}
ILiquidityTreasury.sol 66 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
interface ILiquidityTreasury {
struct TokenInfo {
string name;
uint8 decimals;
uint256 internalPrice;
}
enum Operation { ADD, UPDATE }
function emergencyWithdrawal(address token, address to, uint256 amount) external;
function manageTokenPair(
uint256 pairId,
address tokenA,
address tokenB,
uint256 minAmount,
Operation op
) external;
function manageBondLife(uint256 durationInDays) external;
function manageBondType(
uint256 bondTypeId,
uint256 pairId,
uint256 lifeId,
bool offerActive,
bool settlementActive,
Operation op
) external;
function setBasicReturns(
address[] calldata tokens,
uint256[] calldata lifeIds,
uint256[] calldata returnRates
) external;
function setBatchUserRates(
address[] calldata users,
uint256[] calldata lifeIds,
uint256[] calldata points
) external;
function setReceiver(address to) external;
function setUniversalOfferLoanDisable(bool state) external;
function setUniversalSettlementDisable(bool state) external;
function setUniversalDropOut(bool state) external;
function setUserOfferLoanDisable(address from, bool state) external;
function setUserGetIncentiveDisable(address from, bool state) external;
function setUserSettlementDisable(address from, bool state) external;
function setSingleBondSettlementDisable(uint256 tokenId, bool state) external;
function transferOwnership(address newOwner) external;
function setIncentiveRate(uint256 rate) external;
function setInternalPrice(address token, uint256 price) external;
function setPointConfig(
uint256 lifeId,
uint256 activeUpperLevel,
uint256[] calldata weightFactors
) external;
function updatePoint(address from, uint256 lifeId, uint256 amount) external;
function setPointAirdrop(address to) external;
function setInFlowMode(uint256 mode, bool enabled) external;
function setOutFlowMode(uint256 mode) external;
function setFromPermission(address addr, bool enabled) external;
function setToPermission(address addr, bool enabled) external;
function getTokenInfo(address token) external view returns (TokenInfo memory);
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./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);
}
}
PointAirdrop.sol 117 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./IBarkDao.sol";
import "./ILiquidityTreasury.sol";
import "./IAccelerationProgram.sol";
contract PointAirdrop is Ownable, ReentrancyGuard {
struct AirdropConfig {
uint256 totalCap;
uint256 totalMinted;
uint256 claimAmount;
address pointToken;
}
IBarkDao public barkDao;
ILiquidityTreasury public liquidityTreasury;
mapping(uint256 => AirdropConfig) public airdropConfigs;
mapping(address => mapping(uint256 => bool)) public hasClaimed;
error BarkDaoUnregistered();
error AirdropNotActive();
error AbnormalParameter();
error AlreadyClaimed();
error ExceedsTotalAirdrop();
error InvalidTotalCap();
error InvalidClaimAmount();
event AirdropClaimed(address indexed user, uint256 indexed pointType, uint256 amount);
event CapUpdated(uint256 indexed pointType, uint256 newCap);
event ClaimAmountUpdated(uint256 indexed pointType, uint256 amount);
modifier onlyRegistered() {
IBarkDao.Member memory member = barkDao.members(msg.sender);
if (member.parent == address(0)) revert BarkDaoUnregistered();
_;
}
modifier onlyPointType(uint256 pointType) {
if (pointType == 0 || pointType > 3) revert AbnormalParameter();
_;
}
constructor(
address _barkDAO,
address _liquidityTreasury,
AirdropConfig[] memory configs,
address _owner
) {
barkDao = IBarkDao(_barkDAO);
liquidityTreasury = ILiquidityTreasury(_liquidityTreasury);
for (uint256 x = 0; x < configs.length; x++) {
airdropConfigs[x + 1] = configs[x];
}
transferOwnership(_owner);
}
function claim(uint256 pointType) external nonReentrant onlyRegistered onlyPointType(pointType) {
_claim(pointType);
}
function setTotalCap(uint256 pointType, uint256 newCap) external onlyOwner onlyPointType(pointType) {
AirdropConfig storage config = airdropConfigs[pointType];
if (newCap < config.totalMinted) revert InvalidTotalCap();
config.totalCap = newCap;
emit CapUpdated(pointType, newCap);
}
function setClaimAmount(uint256 pointType, uint256 amount) external onlyOwner onlyPointType(pointType) {
if (amount > 500 ether) revert InvalidClaimAmount();
AirdropConfig storage config = airdropConfigs[pointType];
config.claimAmount = amount;
emit ClaimAmountUpdated(pointType, amount);
}
function getUserClaimStatus(address user) external view returns (bool[3] memory claimed) {
claimed[0] = hasClaimed[user][1];
claimed[1] = hasClaimed[user][2];
claimed[2] = hasClaimed[user][3];
}
function getAllConfigs() external view returns (AirdropConfig[3] memory configs) {
configs[0] = airdropConfigs[1];
configs[1] = airdropConfigs[2];
configs[2] = airdropConfigs[3];
}
function _claim(uint256 pointType) internal {
AirdropConfig storage config = airdropConfigs[pointType];
if (config.claimAmount == 0) revert AirdropNotActive();
if (hasClaimed[msg.sender][pointType]) revert AlreadyClaimed();
uint256 newTotal = config.totalMinted + config.claimAmount;
if (newTotal > config.totalCap) revert ExceedsTotalAirdrop();
hasClaimed[msg.sender][pointType] = true;
config.totalMinted = newTotal;
// update lt v0 point
liquidityTreasury.updatePoint(msg.sender, pointType, config.claimAmount);
// mint point token
IAccelerationProgram(config.pointToken).mint(msg.sender, config.claimAmount);
emit AirdropClaimed(msg.sender, pointType, config.claimAmount);
}
}
ReentrancyGuard.sol 69 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
Read Contract
airdropConfigs 0xe13b54de → uint256, uint256, uint256, address
barkDao 0xe0366ce9 → address
getAllConfigs 0x63507956 → tuple[3]
getUserClaimStatus 0x37b7b3aa → bool[3]
hasClaimed 0xb2931096 → bool
liquidityTreasury 0xb918e5f9 → address
owner 0x8da5cb5b → address
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
claim 0x379607f5
uint256 pointType
renounceOwnership 0x715018a6
No parameters
setClaimAmount 0x0a81c738
uint256 pointType
uint256 amount
setTotalCap 0x0a947351
uint256 pointType
uint256 newCap
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address