S Price: $0.460312 (-1.62%)
    /

    Contract Diff Checker

    Contract Name:
    ReferralReader

    Contract Source Code:

    // SPDX-License-Identifier: MIT
    
    pragma solidity 0.6.12;
    
    interface IReferralStorage {
        function codeOwners(bytes32 _code) external view returns (address);
        function traderReferralCodes(address _account) external view returns (bytes32);
        function referrerDiscountShares(address _account) external view returns (uint256);
        function referrerTiers(address _account) external view returns (uint256);
        function getTraderReferralInfo(address _account) external view returns (bytes32, address);
        function setTraderReferralCode(address _account, bytes32 _code) external;
        function setTier(uint256 _tierId, uint256 _totalRebate, uint256 _discountShare) external;
        function setReferrerTier(address _referrer, uint256 _tierId) external;
        function govSetCodeOwner(bytes32 _code, address _newAccount) external;
    }

    // SPDX-License-Identifier: MIT
    
    pragma solidity 0.6.12;
    
    import "./interfaces/IReferralStorage.sol";
    
    contract ReferralReader {
        function getCodeOwners(IReferralStorage _referralStorage, bytes32[] memory _codes) public view returns (address[] memory) {
            address[] memory owners = new address[](_codes.length);
    
            for (uint256 i = 0; i < _codes.length; i++) {
                bytes32 code = _codes[i];
                owners[i] = _referralStorage.codeOwners(code);
            }
    
            return owners;
        }
    }

    Contract Name:
    ReferralReader

    Contract Source Code:

    // SPDX-License-Identifier: MIT
    
    pragma solidity 0.6.12;
    
    interface IReferralStorage {
        function codeOwners(bytes32 _code) external view returns (address);
        function traderReferralCodes(address _account) external view returns (bytes32);
        function referrerDiscountShares(address _account) external view returns (uint256);
        function referrerTiers(address _account) external view returns (uint256);
        function getTraderReferralInfo(address _account) external view returns (bytes32, address);
        function setTraderReferralCode(address _account, bytes32 _code) external;
        function setTier(uint256 _tierId, uint256 _totalRebate, uint256 _discountShare) external;
        function setReferrerTier(address _referrer, uint256 _tierId) external;
        function govSetCodeOwner(bytes32 _code, address _newAccount) external;
    }

    // SPDX-License-Identifier: MIT
    
    pragma solidity 0.6.12;
    
    import "./interfaces/IReferralStorage.sol";
    
    contract ReferralReader {
        function getCodeOwners(IReferralStorage _referralStorage, bytes32[] memory _codes) public view returns (address[] memory) {
            address[] memory owners = new address[](_codes.length);
    
            for (uint256 i = 0; i < _codes.length; i++) {
                bytes32 code = _codes[i];
                owners[i] = _referralStorage.codeOwners(code);
            }
    
            return owners;
        }
    }

    Context size (optional):