Ditto-money / Bounties

Ditto.money open bounties
0 stars 0 forks source link

Deploy an BEP20 (BUSD) airdrop contract on the Binance Smart chain and format an input list of 30 addresses #2

Closed chefchansey closed 3 years ago

chefchansey commented 3 years ago

Deploy an airdrop smart contract on BSC that is capable of airdropping BUSD to a list of target addresses. The addresses will be provided on Telegram. You can optionally use the source code below to do this.

The second part of this bounty is formatting the target addresses in the required way so they can be copy/pasted into the batchPayout function argument, or - if you use another airdropper - into the respective format.

Steps required to complete this bounty

  1. Deploy the smart contract
  2. Attach the source code on bscscan
  3. Transfer ownership to the address 0x614812d04526C0C882A6cB993a135fcD559F33F9
  4. Prepare inputs required to start the airdrop.

Communication

If you get accepted for this bounty please join the Ditto money Telegram group and DM ChefChansey:

https://t.me/joinchat/Rk6imB3KHsGfVOnVTA0Fmg

// SPDX-License-Identifier: MIT

/*
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
  function totalSupply() external view returns (uint256);

  function balanceOf(address who) external view returns (uint256);

  function allowance(address owner, address spender)
    external view returns (uint256);

  function transfer(address to, uint256 value) external returns (bool);

  function approve(address spender, uint256 value)
    external returns (bool);

  function transferFrom(address from, address to, uint256 value)
    external returns (bool);

  event Transfer(
    address indexed from,
    address indexed to,
    uint256 value
  );

  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address private _owner;

  event OwnershipRenounced(address indexed previousOwner);

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

  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    _owner = msg.sender;
  }

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

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

  /**
   * @return true if `msg.sender` is the owner of the contract.
   */
  function isOwner() public view returns(bool) {
    return msg.sender == _owner;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(_owner);
    _owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    _transferOwnership(newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address newOwner) internal {
    require(newOwner != address(0));
    emit OwnershipTransferred(_owner, newOwner);
    _owner = newOwner;
  }
}

/**
 * @title Rebased Airdrop Contract
 */
contract Airdrop is Ownable {

    IERC20 token;

    struct PaymentInfo {
      address payable payee;
      uint256 amount;
    }
    constructor(address _token) public {
        token = IERC20(_token);
    }

    function batchPayout(PaymentInfo[] calldata info) external onlyOwner {
        for (uint i=0; i < info.length; i++) {
            token.transfer(info[i].payee,info[i].amount);
        }
    }

    function transfer(address to, uint256 amount) external onlyOwner {
        token.transfer(to, amount);
    }    
}
kelonye commented 3 years ago

Does The second part of this bounty is formatting the target addresses in the required way so they can be copy/pasted into the batchPayout function argument, or - if you use another airdropper - into the respective format. mean a frontend that has say, an input that accepts a comma-separated list of the target addresses?

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.35 ETH (214.05 USD @ $611.57/ETH) attached to it.

chefchansey commented 3 years ago

mean a frontend that has say, an input that accepts a comma-separated list of the target addresses?

Yes, this was written with Remix in mind so whatever formatting it uses for a list of strings.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 265 years, 10 months from now. Please review their action plans below:

1) aadorian has applied to start work _(Funders only: approve worker | reject worker)_.

Using IERC20 from original source Openzeppelin , compile and deploy in localtestnet and then binancetestnet and finally deploy https://youtu.be/TZd8HKdJOfw

Sample with remix in localtestnet https://i.imgur.com/YcnOwSS.png https://i.imgur.com/GXRD1SF.png 2) timidan has been approved to start work.

Will do this, already have a ready contract that does airdrops in batches 3) vporton has applied to start work _(Funders only: approve worker | reject worker)_.

I deployed several contracts to BSC just a few days ago.

I know:

In short, I am very qualified to do this.

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.35 ETH (222.14 USD @ $634.69/ETH) has been submitted by:


gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.35 ETH (410.22 USD @ $1172.04/ETH) attached to this issue has been approved & issued to @timidan.