Contract 0xb562221c31c49d6767ccf8b3c067578198632e02

Contract Overview

Balance:
0 AVAX

AVAX Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x1ed6bae83d0f03b0e89eef3907d70e5d884fbd1d55cbbadb78088cb714fee73dWithdraw Benefic...256039842023-01-30 10:08:1415 hrs 10 mins ago0x0971b2d7874a2987b66c65442a2926ff80289205 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.001410864 26
0xb79c68f22c065d8c01c0efe86a4906da24a4426fc8ed47b0f6ba261eac92db61Withdraw Benefic...255420982023-01-28 23:20:152 days 1 hr ago0x5b34932f643a143bdc9801064ea06526ba9476af IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.0022116 25
0xc73da4cf0aa36e320cc8c8b0df9af34ffe2d6854900d64d68224dd5bd6fd7b01Withdraw Benefic...255059562023-01-28 2:52:072 days 22 hrs ago0x0e1e482af12f84fbcea5806f61059ccde3230813 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.0017841 25
0xe2b4a7f0c35eac937c31404eaf8430b4fd79a19e8ef2415396cef2e1042792c7Withdraw Benefic...254315662023-01-26 8:56:344 days 16 hrs ago0x0e1e482af12f84fbcea5806f61059ccde3230813 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.0013566 25
0xf2bb1b275512dbdf1d683e23471afb87de8b32ed4f65299b12efee19e114b2abWithdraw Benefic...254314892023-01-26 8:53:574 days 16 hrs ago0x0971b2d7874a2987b66c65442a2926ff80289205 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.002300064 26
0x8a70ffbcd516be414feb24c767781f3b867fd5c0f455849ac1fce37146af7e7dWithdraw Benefic...254267192023-01-26 6:11:234 days 19 hrs ago0x83afa388d49ed481c12be7d2c11aeab7c084c2a8 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.002300064 26
0x815693541ee4eb8a8f84d34874ef7b0b0c5da1a414b52df0c63ccf23210a6020Withdraw Benefic...254101052023-01-25 20:44:515 days 4 hrs ago0xc135009c21291d72564737f276f41ee653f5c7c0 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.002300064 26
0xff233f9b093f67742d52c07dcc292f8e34500c061169f809432067e3bc5aa888Withdraw Benefic...253931512023-01-25 11:09:355 days 14 hrs ago0x0e1e482af12f84fbcea5806f61059ccde3230813 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.002744664 26
0x3df370668076d90c3110a5ce67162f531da0d26068ccec6334d62cb48f8551ffWithdraw Emergen...253929102023-01-25 11:01:155 days 14 hrs ago0x0e1e482af12f84fbcea5806f61059ccde3230813 IN  0xb562221c31c49d6767ccf8b3c067578198632e020 AVAX0.000982488 26
0xc92159bffb81a1ba4ecdfd6f623d70b0c2ef4e67a796a160dd28b8d38579791f0x60806040253928652023-01-25 10:59:455 days 14 hrs ago0x0e1e482af12f84fbcea5806f61059ccde3230813 IN  Create: Distributor0 AVAX0.021015204 28
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Distributor

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 3 : 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;
    }
}

File 3 of 3 : PtpDistributor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

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

interface PTP {
   function transfer(address dst, uint256 rawAmount) external returns (bool);
   function balanceOf(address account) external view returns (uint256);
   function mint(address dst, uint256 rawAmount) external;
   function minimumTimeBetweenMints() external view returns (uint256);
}


contract Distributor is Ownable{
    mapping(address => uint256) public withdrawn;
    mapping(address => uint256) public allocations;
    uint256 totalPTPWithdrawn;
    PTP public PTPContract = PTP(0x22d4002028f537599bE9f666d1c4Fa138522f9c8);

    error Unauthorized();

    constructor(address[5] memory _beneficiaries)
    {
        allocations[_beneficiaries[0]] = 36363;
        allocations[_beneficiaries[1]] = 36363;
        allocations[_beneficiaries[2]] = 10909;
        allocations[_beneficiaries[3]] = 10909;
        allocations[_beneficiaries[4]] = 5456;
    }

    function changeBeneficiary (address _newBeneficiary) external {
        if ( allocations[msg.sender] == 0 ) { revert Unauthorized();}
        uint256 allocation = allocations[msg.sender];
        uint256 withdrawnBalance = withdrawn[msg.sender];

        allocations[_newBeneficiary] = allocation;
        withdrawn[_newBeneficiary] = withdrawnBalance;

        delete allocations[msg.sender];
        delete withdrawn[msg.sender];
    }

    function withdrawBeneficiary() external {
        uint256 ptpBalance = PTPContract.balanceOf(address(this));
        uint256 totalPTPBalance = totalPTPWithdrawn + ptpBalance ;
        uint256 withdrawable = ((totalPTPBalance * allocations[msg.sender]) / 100000) - withdrawn[msg.sender];
        withdrawn[msg.sender] += withdrawable;
        totalPTPWithdrawn += withdrawable;
        PTPContract.transfer(msg.sender,withdrawable);
    }

    function withdrawEmergency() external onlyOwner {
        uint256 ptpBalance = PTPContract.balanceOf(address(this));
        PTPContract.transfer(msg.sender,ptpBalance);
    }

    function claimable(address _beneficiary) view external returns (uint256) {
        uint256 ptpBalance = PTPContract.balanceOf(address(this));
        uint256 totalPTPBalance = totalPTPWithdrawn + ptpBalance ;
        return (((totalPTPBalance * allocations[_beneficiary]) / 100000) - withdrawn[_beneficiary]);
    } 
}

Settings
{
  "remappings": [
    "@openzeppelin/=node_modules/@openzeppelin/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address[5]","name":"_beneficiaries","type":"address[5]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"PTPContract","outputs":[{"internalType":"contract PTP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allocations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newBeneficiary","type":"address"}],"name":"changeBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawEmergency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052600480546001600160a01b0319167322d4002028f537599be9f666d1c4fa138522f9c817905534801561003657600080fd5b50604051610b80380380610b8083398101604081905261005591610133565b61005e336100c7565b80516001600160a01b039081166000908152600260209081526040808320618e0b908190559185015184168352808320919091558084015183168252808220612a9d908190556060850151841683528183205560809093015190911681522061155090556101c5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461012e57600080fd5b919050565b600060a0828403121561014557600080fd5b82601f83011261015457600080fd5b60405160a081016001600160401b038111828210171561018457634e487b7160e01b600052604160045260246000fd5b6040528060a084018581111561019957600080fd5b845b818110156101ba576101ac81610117565b83526020928301920161019b565b509195945050505050565b6109ac806101d46000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c80637fa863cb1161007657806398a34fef1161005b57806398a34fef1461019e578063dc070657146101a6578063f2fde38b146101b957600080fd5b80637fa863cb1461013b5780638da5cb5b1461018057600080fd5b806352a9039c116100a757806352a9039c146100f35780636ef6109214610113578063715018a61461013357600080fd5b8063402914f5146100c35780634146a073146100e9575b600080fd5b6100d66100d1366004610851565b6101cc565b6040519081526020015b60405180910390f35b6100f16102d7565b005b6100d6610101366004610851565b60026020526000908152604090205481565b6100d6610121366004610851565b60016020526000908152604090205481565b6100f161041c565b60045461015b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e0565b60005473ffffffffffffffffffffffffffffffffffffffff1661015b565b6100f1610430565b6100f16101b4366004610851565b610601565b6100f16101c7366004610851565b61069f565b600480546040517f70a082310000000000000000000000000000000000000000000000000000000081523092810192909252600091829173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610240573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610264919061088e565b905060008160035461027691906108d6565b73ffffffffffffffffffffffffffffffffffffffff851660009081526001602090815260408083205460029092529091205491925090620186a0906102bb90846108ef565b6102c59190610906565b6102cf9190610941565b949350505050565b6102df61075b565b600480546040517f70a08231000000000000000000000000000000000000000000000000000000008152309281019290925260009173ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015610353573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610377919061088e565b600480546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815233928101929092526024820183905291925073ffffffffffffffffffffffffffffffffffffffff9091169063a9059cbb906044016020604051808303816000875af11580156103f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104189190610954565b5050565b61042461075b565b61042e60006107dc565b565b600480546040517f70a08231000000000000000000000000000000000000000000000000000000008152309281019290925260009173ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa1580156104a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c8919061088e565b90506000816003546104da91906108d6565b3360009081526001602090815260408083205460029092528220549293509091620186a09061050990856108ef565b6105139190610906565b61051d9190610941565b336000908152600160205260408120805492935083929091906105419084906108d6565b92505081905550806003600082825461055a91906108d6565b9091555050600480546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815233928101929092526024820183905273ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af11580156105d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190610954565b50505050565b336000908152600260205260408120549003610649576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260026020818152604080842080546001808552838720805473ffffffffffffffffffffffffffffffffffffffff9a909a168852958552838720919091559092528320949094559181529182905555565b6106a761075b565b73ffffffffffffffffffffffffffffffffffffffff811661074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610758816107dc565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461042e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610746565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561086357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461088757600080fd5b9392505050565b6000602082840312156108a057600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108e9576108e96108a7565b92915050565b80820281158282048414176108e9576108e96108a7565b60008261093c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156108e9576108e96108a7565b60006020828403121561096657600080fd5b8151801515811461088757600080fdfea264697066735822122074d604abafe9f25ff193499942c22c095d3fa22beaa01835a0eb1d4ffcad752564736f6c6343000811003300000000000000000000000083afa388d49ed481c12be7d2c11aeab7c084c2a80000000000000000000000000e1e482af12f84fbcea5806f61059ccde32308130000000000000000000000000971b2d7874a2987b66c65442a2926ff802892050000000000000000000000005b34932f643a143bdc9801064ea06526ba9476af000000000000000000000000c135009c21291d72564737f276f41ee653f5c7c0

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000083afa388d49ed481c12be7d2c11aeab7c084c2a80000000000000000000000000e1e482af12f84fbcea5806f61059ccde32308130000000000000000000000000971b2d7874a2987b66c65442a2926ff802892050000000000000000000000005b34932f643a143bdc9801064ea06526ba9476af000000000000000000000000c135009c21291d72564737f276f41ee653f5c7c0

-----Decoded View---------------
Arg [0] : _beneficiaries (address[5]): 0x83afa388d49ed481c12be7d2c11aeab7c084c2a8,0x0e1e482af12f84fbcea5806f61059ccde3230813,0x0971b2d7874a2987b66c65442a2926ff80289205,0x5b34932f643a143bdc9801064ea06526ba9476af,0xc135009c21291d72564737f276f41ee653f5c7c0

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000083afa388d49ed481c12be7d2c11aeab7c084c2a8
Arg [1] : 0000000000000000000000000e1e482af12f84fbcea5806f61059ccde3230813
Arg [2] : 0000000000000000000000000971b2d7874a2987b66c65442a2926ff80289205
Arg [3] : 0000000000000000000000005b34932f643a143bdc9801064ea06526ba9476af
Arg [4] : 000000000000000000000000c135009c21291d72564737f276f41ee653f5c7c0


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.