Skip to content

FixedRateTaxController

FixedRateTaxController

FixedRateTaxControllerInitParams

struct FixedRateTaxControllerInitParams {
  contract IACL acl;
  contract IMetahub metahub;
}

constructor

constructor() public

initialize

function initialize(struct FixedRateTaxController.FixedRateTaxControllerInitParams params) external

Contract initializer.

Name Type Description
params struct FixedRateTaxController.FixedRateTaxControllerInitParams Init params.

calculateRentalTax

function calculateRentalTax(struct ITaxTermsRegistry.Params taxTermsParams, struct Rentings.Params, uint256 taxableAmount) external view returns (uint256 universeBaseTax, uint256 protocolBaseTax, struct ITaxTermsRegistry.TaxTerms universeTaxTerms, struct ITaxTermsRegistry.TaxTerms protocolTaxTerms)

Calculates rental tax based on renting params and implemented taxation strategy.

Name Type Description
taxTermsParams struct ITaxTermsRegistry.Params Listing tax strategy override params.
struct Rentings.Params
taxableAmount uint256 Total taxable amount.
Name Type Description
universeBaseTax uint256 Universe rental tax (taxableAmount * universeBaseTax / 100%).
protocolBaseTax uint256 Protocol rental tax (taxableAmount * protocolBaseTax / 100%).
universeTaxTerms struct ITaxTermsRegistry.TaxTerms Universe tax terms.
protocolTaxTerms struct ITaxTermsRegistry.TaxTerms Protocol tax terms.

contractKey

function contractKey() external pure returns (bytes4)

Returns implemented contract key.

Name Type Description
[0] bytes4 Contract key;

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

strategyId

function strategyId() public pure returns (bytes4)

Returns implemented listing tax strategy ID.

Name Type Description
[0] bytes4 Taxation strategy ID.

decodeStrategyParams

function decodeStrategyParams(struct ITaxTermsRegistry.TaxTerms terms) public pure returns (uint16 baseTaxRate)

Decodes tax terms data.

Name Type Description
terms struct ITaxTermsRegistry.TaxTerms Encoded tax terms.
Name Type Description
baseTaxRate uint16 Asset renting base tax (base rate per rental).

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.

Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.

```solidity function authorizeUpgrade(address) internal override onlyOwner {} ```

_acl

function _acl() internal view returns (contract IACL)

return the IACL address