Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- ReferralReader
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 16
- Verified at
- 2023-07-04T13:21:43.651898Z
contracts/referrals/ReferralReader.sol
// 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; } }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
contracts/referrals/interfaces/IReferralStorage.sol
// 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; }
Contract ABI
[{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getCodeOwners","inputs":[{"type":"address","name":"_referralStorage","internalType":"contract IReferralStorage"},{"type":"bytes32[]","name":"_codes","internalType":"bytes32[]"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50610279806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80630f6803c014610030575b600080fd5b6100e16004803603604081101561004657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561007057600080fd5b82018360208201111561008257600080fd5b803590602001918460208302840111600160201b831117156100a357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610131945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561011d578181015183820152602001610105565b505050509050019250505060405180910390f35b60608082516001600160401b038111801561014b57600080fd5b50604051908082528060200260200182016040528015610175578160200160208202803683370190505b50905060005b835181101561023b57600084828151811061019257fe5b60200260200101519050856001600160a01b031663c8b3c460826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156101e057600080fd5b505afa1580156101f4573d6000803e3d6000fd5b505050506040513d602081101561020a57600080fd5b5051835184908490811061021a57fe5b6001600160a01b03909216602092830291909101909101525060010161017b565b50939250505056fea264697066735822122083ee91ada23a3da21c038bd592c69656f082e41774102ef31954232f586ee6c064736f6c634300060c0033
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80630f6803c014610030575b600080fd5b6100e16004803603604081101561004657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561007057600080fd5b82018360208201111561008257600080fd5b803590602001918460208302840111600160201b831117156100a357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610131945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561011d578181015183820152602001610105565b505050509050019250505060405180910390f35b60608082516001600160401b038111801561014b57600080fd5b50604051908082528060200260200182016040528015610175578160200160208202803683370190505b50905060005b835181101561023b57600084828151811061019257fe5b60200260200101519050856001600160a01b031663c8b3c460826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156101e057600080fd5b505afa1580156101f4573d6000803e3d6000fd5b505050506040513d602081101561020a57600080fd5b5051835184908490811061021a57fe5b6001600160a01b03909216602092830291909101909101525060010161017b565b50939250505056fea264697066735822122083ee91ada23a3da21c038bd592c69656f082e41774102ef31954232f586ee6c064736f6c634300060c0033