{"sources":{"BUSDImplementation.sol":{"content":"// File: contracts/zeppelin/SafeMath.sol\r\n\r\npragma solidity 0.4.24;\r\n\r\n\r\n/**\r\n * @title SafeMath\r\n * @dev Math operations with safety checks that throw on error\r\n */\r\nlibrary SafeMath {\r\n    /**\r\n    * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\r\n    */\r\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        require(b <= a);\r\n        uint256 c = a - b;\r\n\r\n        return c;\r\n    }\r\n\r\n    /**\r\n    * @dev Adds two numbers, reverts on overflow.\r\n    */\r\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        uint256 c = a + b;\r\n        require(c >= a);\r\n\r\n        return c;\r\n    }\r\n}\r\n\r\n// File: contracts/BUSDImplementation.sol\r\n\r\npragma solidity 0.4.24;\r\npragma experimental \"v0.5.0\";\r\n\r\n\r\n\r\n/**\r\n * @title BUSDImplementation\r\n * @dev this contract is a Pausable ERC20 token with Burn and Mint\r\n * controlled by a central SupplyController. By implementing BUSDImplementation\r\n * this contract also includes external methods for setting\r\n * a new implementation contract for the Proxy.\r\n * NOTE: The storage defined here will actually be held in the Proxy\r\n * contract and all calls to this contract should be made through\r\n * the proxy, including admin actions done as owner or supplyController.\r\n * Any call to transfer against this contract should fail\r\n * with insufficient funds since no tokens will be issued there.\r\n */\r\ncontract BUSDImplementation {\r\n\r\n    /**\r\n     * MATH\r\n     */\r\n\r\n    using SafeMath for uint256;\r\n\r\n    /**\r\n     * DATA\r\n     */\r\n\r\n    // INITIALIZATION DATA\r\n    bool private initialized = false;\r\n\r\n    // ERC20 BASIC DATA\r\n    mapping(address => uint256) internal balances;\r\n    uint256 internal totalSupply_;\r\n    string public constant name = \"BUSD\"; // solium-disable-line\r\n    string public constant symbol = \"BUSD\"; // solium-disable-line uppercase\r\n    uint8 public constant decimals = 18; // solium-disable-line uppercase\r\n\r\n    // ERC20 DATA\r\n    mapping(address => mapping(address => uint256)) internal allowed;\r\n\r\n    // OWNER DATA\r\n    address public owner;\r\n    address public proposedOwner;\r\n\r\n    // PAUSABILITY DATA\r\n    bool public paused = false;\r\n\r\n    // ASSET PROTECTION DATA\r\n    address public assetProtectionRole;\r\n    mapping(address => bool) internal frozen;\r\n\r\n    // SUPPLY CONTROL DATA\r\n    address public supplyController;\r\n\r\n    // DELEGATED TRANSFER DATA\r\n    address public betaDelegateWhitelister;\r\n    mapping(address => bool) internal betaDelegateWhitelist;\r\n    mapping(address => uint256) internal nextSeqs;\r\n    // EIP191 header for EIP712 prefix\r\n    string constant internal EIP191_HEADER = \"\\x19\\x01\";\r\n    // Hash of the EIP712 Domain Separator Schema\r\n    bytes32 constant internal EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = keccak256(\r\n        \"EIP712Domain(string name,address verifyingContract)\"\r\n    );\r\n    bytes32 constant internal EIP712_DELEGATED_TRANSFER_SCHEMA_HASH = keccak256(\r\n        \"BetaDelegatedTransfer(address to,uint256 value,uint256 fee,uint256 seq,uint256 deadline)\"\r\n    );\r\n    // Hash of the EIP712 Domain Separator data\r\n    // solhint-disable-next-line var-name-mixedcase\r\n    bytes32 public EIP712_DOMAIN_HASH;\r\n\r\n    /**\r\n     * EVENTS\r\n     */\r\n\r\n    // ERC20 BASIC EVENTS\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n    // ERC20 EVENTS\r\n    event Approval(\r\n        address indexed owner,\r\n        address indexed spender,\r\n        uint256 value\r\n    );\r\n\r\n    // OWNABLE EVENTS\r\n    event OwnershipTransferProposed(\r\n        address indexed currentOwner,\r\n        address indexed proposedOwner\r\n    );\r\n    event OwnershipTransferDisregarded(\r\n        address indexed oldProposedOwner\r\n    );\r\n    event OwnershipTransferred(\r\n        address indexed oldOwner,\r\n        address indexed newOwner\r\n    );\r\n\r\n    // PAUSABLE EVENTS\r\n    event Pause();\r\n    event Unpause();\r\n\r\n    // ASSET PROTECTION EVENTS\r\n    event AddressFrozen(address indexed addr);\r\n    event AddressUnfrozen(address indexed addr);\r\n    event FrozenAddressWiped(address indexed addr);\r\n    event AssetProtectionRoleSet (\r\n        address indexed oldAssetProtectionRole,\r\n        address indexed newAssetProtectionRole\r\n    );\r\n\r\n    // SUPPLY CONTROL EVENTS\r\n    event SupplyIncreased(address indexed to, uint256 value);\r\n    event SupplyDecreased(address indexed from, uint256 value);\r\n    event SupplyControllerSet(\r\n        address indexed oldSupplyController,\r\n        address indexed newSupplyController\r\n    );\r\n\r\n    // DELEGATED TRANSFER EVENTS\r\n    event BetaDelegatedTransfer(\r\n        address indexed from, address indexed to, uint256 value, uint256 seq, uint256 fee\r\n    );\r\n    event BetaDelegateWhitelisterSet(\r\n        address indexed oldWhitelister,\r\n        address indexed newWhitelister\r\n    );\r\n    event BetaDelegateWhitelisted(address indexed newDelegate);\r\n    event BetaDelegateUnwhitelisted(address indexed oldDelegate);\r\n\r\n    /**\r\n     * FUNCTIONALITY\r\n     */\r\n\r\n    // INITIALIZATION FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev sets 0 initials tokens, the owner, and the supplyController.\r\n     * this serves as the constructor for the proxy but compiles to the\r\n     * memory model of the Implementation contract.\r\n     */\r\n    function initialize() public {\r\n        require(!initialized, \"already initialized\");\r\n        owner = msg.sender;\r\n        proposedOwner = address(0);\r\n        assetProtectionRole = address(0);\r\n        totalSupply_ = 0;\r\n        supplyController = msg.sender;\r\n        initialized = true;\r\n    }\r\n\r\n    /**\r\n     * The constructor is used here to ensure that the implementation\r\n     * contract is initialized. An uncontrolled implementation\r\n     * contract might lead to misleading state\r\n     * for users who accidentally interact with it.\r\n     */\r\n    constructor() public {\r\n        initialize();\r\n        pause();\r\n        // Added in V2\r\n        initializeDomainSeparator();\r\n    }\r\n\r\n    /**\r\n     * @dev To be called when upgrading the contract using upgradeAndCall to add delegated transfers\r\n     */\r\n    function initializeDomainSeparator() public {\r\n        // hash the name context with the contract address\r\n        EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(// solium-disable-line\r\n                EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\r\n                keccak256(bytes(name)),\r\n                bytes32(address(this))\r\n            ));\r\n    }\r\n\r\n    // ERC20 BASIC FUNCTIONALITY\r\n\r\n    /**\r\n    * @dev Total number of tokens in existence\r\n    */\r\n    function totalSupply() public view returns (uint256) {\r\n        return totalSupply_;\r\n    }\r\n\r\n    /**\r\n    * @dev Transfer token to a specified address from msg.sender\r\n    * Note: the use of Safemath ensures that _value is nonnegative.\r\n    * @param _to The address to transfer to.\r\n    * @param _value The amount to be transferred.\r\n    */\r\n    function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {\r\n        require(_to != address(0), \"cannot transfer to address zero\");\r\n        require(!frozen[_to] && !frozen[msg.sender], \"address frozen\");\r\n        require(_value <= balances[msg.sender], \"insufficient funds\");\r\n\r\n        balances[msg.sender] = balances[msg.sender].sub(_value);\r\n        balances[_to] = balances[_to].add(_value);\r\n        emit Transfer(msg.sender, _to, _value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n    * @dev Gets the balance of the specified address.\r\n    * @param _addr The address to query the the balance of.\r\n    * @return An uint256 representing the amount owned by the passed address.\r\n    */\r\n    function balanceOf(address _addr) public view returns (uint256) {\r\n        return balances[_addr];\r\n    }\r\n\r\n    // ERC20 FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev Transfer tokens from one address to another\r\n     * @param _from address The address which you want to send tokens from\r\n     * @param _to address The address which you want to transfer to\r\n     * @param _value uint256 the amount of tokens to be transferred\r\n     */\r\n    function transferFrom(\r\n        address _from,\r\n        address _to,\r\n        uint256 _value\r\n    )\r\n    public\r\n    whenNotPaused\r\n    returns (bool)\r\n    {\r\n        require(_to != address(0), \"cannot transfer to address zero\");\r\n        require(!frozen[_to] && !frozen[_from] && !frozen[msg.sender], \"address frozen\");\r\n        require(_value <= balances[_from], \"insufficient funds\");\r\n        require(_value <= allowed[_from][msg.sender], \"insufficient allowance\");\r\n\r\n        balances[_from] = balances[_from].sub(_value);\r\n        balances[_to] = balances[_to].add(_value);\r\n        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);\r\n        emit Transfer(_from, _to, _value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.\r\n     * Beware that changing an allowance with this method brings the risk that someone may use both the old\r\n     * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this\r\n     * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:\r\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n     * @param _spender The address which will spend the funds.\r\n     * @param _value The amount of tokens to be spent.\r\n     */\r\n    function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {\r\n        require(!frozen[_spender] && !frozen[msg.sender], \"address frozen\");\r\n        allowed[msg.sender][_spender] = _value;\r\n        emit Approval(msg.sender, _spender, _value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Function to check the amount of tokens that an owner allowed to a spender.\r\n     * @param _owner address The address which owns the funds.\r\n     * @param _spender address The address which will spend the funds.\r\n     * @return A uint256 specifying the amount of tokens still available for the spender.\r\n     */\r\n    function allowance(\r\n        address _owner,\r\n        address _spender\r\n    )\r\n    public\r\n    view\r\n    returns (uint256)\r\n    {\r\n        return allowed[_owner][_spender];\r\n    }\r\n\r\n    // OWNER FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev Throws if called by any account other than the owner.\r\n     */\r\n    modifier onlyOwner() {\r\n        require(msg.sender == owner, \"onlyOwner\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Allows the current owner to begin transferring control of the contract to a proposedOwner\r\n     * @param _proposedOwner The address to transfer ownership to.\r\n     */\r\n    function proposeOwner(address _proposedOwner) public onlyOwner {\r\n        require(_proposedOwner != address(0), \"cannot transfer ownership to address zero\");\r\n        require(msg.sender != _proposedOwner, \"caller already is owner\");\r\n        proposedOwner = _proposedOwner;\r\n        emit OwnershipTransferProposed(owner, proposedOwner);\r\n    }\r\n\r\n    /**\r\n     * @dev Allows the current owner or proposed owner to cancel transferring control of the contract to a proposedOwner\r\n     */\r\n    function disregardProposeOwner() public {\r\n        require(msg.sender == proposedOwner || msg.sender == owner, \"only proposedOwner or owner\");\r\n        require(proposedOwner != address(0), \"can only disregard a proposed owner that was previously set\");\r\n        address _oldProposedOwner = proposedOwner;\r\n        proposedOwner = address(0);\r\n        emit OwnershipTransferDisregarded(_oldProposedOwner);\r\n    }\r\n\r\n    /**\r\n     * @dev Allows the proposed owner to complete transferring control of the contract to the proposedOwner.\r\n     */\r\n    function claimOwnership() public {\r\n        require(msg.sender == proposedOwner, \"onlyProposedOwner\");\r\n        address _oldOwner = owner;\r\n        owner = proposedOwner;\r\n        proposedOwner = address(0);\r\n        emit OwnershipTransferred(_oldOwner, owner);\r\n    }\r\n\r\n    /**\r\n     * @dev Reclaim all BUSD at the contract address.\r\n     * This sends the BUSD tokens that this contract add holding to the owner.\r\n     * Note: this is not affected by freeze constraints.\r\n     */\r\n    function reclaimBUSD() external onlyOwner {\r\n        uint256 _balance = balances[this];\r\n        balances[this] = 0;\r\n        balances[owner] = balances[owner].add(_balance);\r\n        emit Transfer(this, owner, _balance);\r\n    }\r\n\r\n    // PAUSABILITY FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev Modifier to make a function callable only when the contract is not paused.\r\n     */\r\n    modifier whenNotPaused() {\r\n        require(!paused, \"whenNotPaused\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev called by the owner to pause, triggers stopped state\r\n     */\r\n    function pause() public onlyOwner {\r\n        require(!paused, \"already paused\");\r\n        paused = true;\r\n        emit Pause();\r\n    }\r\n\r\n    /**\r\n     * @dev called by the owner to unpause, returns to normal state\r\n     */\r\n    function unpause() public onlyOwner {\r\n        require(paused, \"already unpaused\");\r\n        paused = false;\r\n        emit Unpause();\r\n    }\r\n\r\n    // ASSET PROTECTION FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev Sets a new asset Protection role address.\r\n     * @param _newAssetProtectionRole The new address allowed to freeze/unfreeze addresses and seize their tokens.\r\n     */\r\n    function setAssetProtectionRole(address _newAssetProtectionRole) public {\r\n        require(msg.sender == assetProtectionRole || msg.sender == owner, \"only assetProtectionRole or Owner\");\r\n        emit AssetProtectionRoleSet(assetProtectionRole, _newAssetProtectionRole);\r\n        assetProtectionRole = _newAssetProtectionRole;\r\n    }\r\n\r\n    modifier onlyAssetProtectionRole() {\r\n        require(msg.sender == assetProtectionRole, \"onlyAssetProtectionRole\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Freezes an address balance from being transferred.\r\n     * @param _addr The new address to freeze.\r\n     */\r\n    function freeze(address _addr) public onlyAssetProtectionRole {\r\n        require(!frozen[_addr], \"address already frozen\");\r\n        frozen[_addr] = true;\r\n        emit AddressFrozen(_addr);\r\n    }\r\n\r\n    /**\r\n     * @dev Unfreezes an address balance allowing transfer.\r\n     * @param _addr The new address to unfreeze.\r\n     */\r\n    function unfreeze(address _addr) public onlyAssetProtectionRole {\r\n        require(frozen[_addr], \"address already unfrozen\");\r\n        frozen[_addr] = false;\r\n        emit AddressUnfrozen(_addr);\r\n    }\r\n\r\n    /**\r\n     * @dev Wipes the balance of a frozen address, burning the tokens\r\n     * and setting the approval to zero.\r\n     * @param _addr The new frozen address to wipe.\r\n     */\r\n    function wipeFrozenAddress(address _addr) public onlyAssetProtectionRole {\r\n        require(frozen[_addr], \"address is not frozen\");\r\n        uint256 _balance = balances[_addr];\r\n        balances[_addr] = 0;\r\n        totalSupply_ = totalSupply_.sub(_balance);\r\n        emit FrozenAddressWiped(_addr);\r\n        emit SupplyDecreased(_addr, _balance);\r\n        emit Transfer(_addr, address(0), _balance);\r\n    }\r\n\r\n    /**\r\n    * @dev Gets whether the address is currently frozen.\r\n    * @param _addr The address to check if frozen.\r\n    * @return A bool representing whether the given address is frozen.\r\n    */\r\n    function isFrozen(address _addr) public view returns (bool) {\r\n        return frozen[_addr];\r\n    }\r\n\r\n    // SUPPLY CONTROL FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev Sets a new supply controller address.\r\n     * @param _newSupplyController The address allowed to burn/mint tokens to control supply.\r\n     */\r\n    function setSupplyController(address _newSupplyController) public {\r\n        require(msg.sender == supplyController || msg.sender == owner, \"only SupplyController or Owner\");\r\n        require(_newSupplyController != address(0), \"cannot set supply controller to address zero\");\r\n        emit SupplyControllerSet(supplyController, _newSupplyController);\r\n        supplyController = _newSupplyController;\r\n    }\r\n\r\n    modifier onlySupplyController() {\r\n        require(msg.sender == supplyController, \"onlySupplyController\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Increases the total supply by minting the specified number of tokens to the supply controller account.\r\n     * @param _value The number of tokens to add.\r\n     * @return A boolean that indicates if the operation was successful.\r\n     */\r\n    function increaseSupply(uint256 _value) public onlySupplyController returns (bool success) {\r\n        totalSupply_ = totalSupply_.add(_value);\r\n        balances[supplyController] = balances[supplyController].add(_value);\r\n        emit SupplyIncreased(supplyController, _value);\r\n        emit Transfer(address(0), supplyController, _value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Decreases the total supply by burning the specified number of tokens from the supply controller account.\r\n     * @param _value The number of tokens to remove.\r\n     * @return A boolean that indicates if the operation was successful.\r\n     */\r\n    function decreaseSupply(uint256 _value) public onlySupplyController returns (bool success) {\r\n        require(_value <= balances[supplyController], \"not enough supply\");\r\n        balances[supplyController] = balances[supplyController].sub(_value);\r\n        totalSupply_ = totalSupply_.sub(_value);\r\n        emit SupplyDecreased(supplyController, _value);\r\n        emit Transfer(supplyController, address(0), _value);\r\n        return true;\r\n    }\r\n\r\n    // DELEGATED TRANSFER FUNCTIONALITY\r\n\r\n    /**\r\n     * @dev returns the next seq for a target address.\r\n     * The transactor must submit nextSeqOf(transactor) in the next transaction for it to be valid.\r\n     * Note: that the seq context is specific to this smart contract.\r\n     * @param target The target address.\r\n     * @return the seq.\r\n     */\r\n    //\r\n    function nextSeqOf(address target) public view returns (uint256) {\r\n        return nextSeqs[target];\r\n    }\r\n\r\n    /**\r\n     * @dev Performs a transfer on behalf of the from address, identified by its signature on the delegatedTransfer msg.\r\n     * Splits a signature byte array into r,s,v for convenience.\r\n     * @param sig the signature of the delgatedTransfer msg.\r\n     * @param to The address to transfer to.\r\n     * @param value The amount to be transferred.\r\n     * @param fee an optional ERC20 fee paid to the executor of betaDelegatedTransfer by the from address.\r\n     * @param seq a sequencing number included by the from address specific to this contract to protect from replays.\r\n     * @param deadline a block number after which the pre-signed transaction has expired.\r\n     * @return A boolean that indicates if the operation was successful.\r\n     */\r\n    function betaDelegatedTransfer(\r\n        bytes sig, address to, uint256 value, uint256 fee, uint256 seq, uint256 deadline\r\n    ) public returns (bool) {\r\n        require(sig.length == 65, \"signature should have length 65\");\r\n        bytes32 r;\r\n        bytes32 s;\r\n        uint8 v;\r\n        assembly {\r\n            r := mload(add(sig, 32))\r\n            s := mload(add(sig, 64))\r\n            v := byte(0, mload(add(sig, 96)))\r\n        }\r\n        require(_betaDelegatedTransfer(r, s, v, to, value, fee, seq, deadline), \"failed transfer\");\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Performs a transfer on behalf of the from address, identified by its signature on the betaDelegatedTransfer msg.\r\n     * Note: both the delegate and transactor sign in the fees. The transactor, however,\r\n     * has no control over the gas price, and therefore no control over the transaction time.\r\n     * Beta prefix chosen to avoid a name clash with an emerging standard in ERC865 or elsewhere.\r\n     * Internal to the contract - see betaDelegatedTransfer and betaDelegatedTransferBatch.\r\n     * @param r the r signature of the delgatedTransfer msg.\r\n     * @param s the s signature of the delgatedTransfer msg.\r\n     * @param v the v signature of the delgatedTransfer msg.\r\n     * @param to The address to transfer to.\r\n     * @param value The amount to be transferred.\r\n     * @param fee an optional ERC20 fee paid to the delegate of betaDelegatedTransfer by the from address.\r\n     * @param seq a sequencing number included by the from address specific to this contract to protect from replays.\r\n     * @param deadline a block number after which the pre-signed transaction has expired.\r\n     * @return A boolean that indicates if the operation was successful.\r\n     */\r\n    function _betaDelegatedTransfer(\r\n        bytes32 r, bytes32 s, uint8 v, address to, uint256 value, uint256 fee, uint256 seq, uint256 deadline\r\n    ) internal whenNotPaused returns (bool) {\r\n        require(betaDelegateWhitelist[msg.sender], \"Beta feature only accepts whitelisted delegates\");\r\n        require(value > 0 || fee > 0, \"cannot transfer zero tokens with zero fee\");\r\n        require(block.number <= deadline, \"transaction expired\");\r\n        // prevent sig malleability from ecrecover()\r\n        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, \"signature incorrect\");\r\n        require(v == 27 || v == 28, \"signature incorrect\");\r\n\r\n        // EIP712 scheme: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md\r\n        bytes32 delegatedTransferHash = keccak256(abi.encodePacked(// solium-disable-line\r\n                EIP712_DELEGATED_TRANSFER_SCHEMA_HASH, bytes32(to), value, fee, seq, deadline\r\n            ));\r\n        bytes32 hash = keccak256(abi.encodePacked(EIP191_HEADER, EIP712_DOMAIN_HASH, delegatedTransferHash));\r\n        address _from = ecrecover(hash, v, r, s);\r\n\r\n        require(_from != address(0), \"error determining from address from signature\");\r\n        require(to != address(0), \"canno use address zero\");\r\n        require(!frozen[to] && !frozen[_from] && !frozen[msg.sender], \"address frozen\");\r\n        require(value.add(fee) <= balances[_from], \"insufficent fund\");\r\n        require(nextSeqs[_from] == seq, \"incorrect seq\");\r\n\r\n        nextSeqs[_from] = nextSeqs[_from].add(1);\r\n        balances[_from] = balances[_from].sub(value.add(fee));\r\n\r\n        if (fee != 0) {\r\n            balances[msg.sender] = balances[msg.sender].add(fee);\r\n            emit Transfer(_from, msg.sender, fee);\r\n        }\r\n\r\n        balances[to] = balances[to].add(value);\r\n        emit Transfer(_from, to, value);\r\n\r\n        emit BetaDelegatedTransfer(_from, to, value, seq, fee);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Performs an atomic batch of transfers on behalf of the from addresses, identified by their signatures.\r\n     * Lack of nested array support in arguments requires all arguments to be passed as equal size arrays where\r\n     * delegated transfer number i is the combination of all arguments at index i\r\n     * @param r the r signatures of the delgatedTransfer msg.\r\n     * @param s the s signatures of the delgatedTransfer msg.\r\n     * @param v the v signatures of the delgatedTransfer msg.\r\n     * @param to The addresses to transfer to.\r\n     * @param value The amounts to be transferred.\r\n     * @param fee optional ERC20 fees paid to the delegate of betaDelegatedTransfer by the from address.\r\n     * @param seq sequencing numbers included by the from address specific to this contract to protect from replays.\r\n     * @param deadline block numbers after which the pre-signed transactions have expired.\r\n     * @return A boolean that indicates if the operation was successful.\r\n     */\r\n    function betaDelegatedTransferBatch(\r\n        bytes32[] r, bytes32[] s, uint8[] v, address[] to, uint256[] value, uint256[] fee, uint256[] seq, uint256[] deadline\r\n    ) public returns (bool) {\r\n        require(r.length == s.length && r.length == v.length && r.length == to.length && r.length == value.length, \"length mismatch\");\r\n        require(r.length == fee.length && r.length == seq.length && r.length == deadline.length, \"length mismatch\");\r\n\r\n        for (uint i = 0; i < r.length; i++) {\r\n            require(\r\n                _betaDelegatedTransfer(r[i], s[i], v[i], to[i], value[i], fee[i], seq[i], deadline[i]),\r\n                \"failed transfer\"\r\n            );\r\n        }\r\n        return true;\r\n    }\r\n\r\n    /**\r\n    * @dev Gets whether the address is currently whitelisted for betaDelegateTransfer.\r\n    * @param _addr The address to check if whitelisted.\r\n    * @return A bool representing whether the given address is whitelisted.\r\n    */\r\n    function isWhitelistedBetaDelegate(address _addr) public view returns (bool) {\r\n        return betaDelegateWhitelist[_addr];\r\n    }\r\n\r\n    /**\r\n     * @dev Sets a new betaDelegate whitelister.\r\n     * @param _newWhitelister The address allowed to whitelist betaDelegates.\r\n     */\r\n    function setBetaDelegateWhitelister(address _newWhitelister) public {\r\n        require(msg.sender == betaDelegateWhitelister || msg.sender == owner, \"only Whitelister or Owner\");\r\n        betaDelegateWhitelister = _newWhitelister;\r\n        emit BetaDelegateWhitelisterSet(betaDelegateWhitelister, _newWhitelister);\r\n    }\r\n\r\n    modifier onlyBetaDelegateWhitelister() {\r\n        require(msg.sender == betaDelegateWhitelister, \"onlyBetaDelegateWhitelister\");\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev Whitelists an address to allow calling BetaDelegatedTransfer.\r\n     * @param _addr The new address to whitelist.\r\n     */\r\n    function whitelistBetaDelegate(address _addr) public onlyBetaDelegateWhitelister {\r\n        require(!betaDelegateWhitelist[_addr], \"delegate already whitelisted\");\r\n        betaDelegateWhitelist[_addr] = true;\r\n        emit BetaDelegateWhitelisted(_addr);\r\n    }\r\n\r\n    /**\r\n     * @dev Unwhitelists an address to disallow calling BetaDelegatedTransfer.\r\n     * @param _addr The new address to whitelist.\r\n     */\r\n    function unwhitelistBetaDelegate(address _addr) public onlyBetaDelegateWhitelister {\r\n        require(betaDelegateWhitelist[_addr], \"delegate not whitelisted\");\r\n        betaDelegateWhitelist[_addr] = false;\r\n        emit BetaDelegateUnwhitelisted(_addr);\r\n    }\r\n}"}},"matchId":"2273532","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2024-08-08T14:58:40Z","match":"match","chainId":"1","address":"0x2A3F1A37C04F82aA274f5353834B2d002Db91015"}