Skip to content

Policy Contract ​

Back to Native Contracts

Controls network-wide policy parameters. Most setter methods require committee multi-signature authorization.

Methods ​

MethodSignatureReturnSafeEmbedded runtime behavior
getFeePerBytegetFeePerByte()uint256✅Returns current embedded fee-per-byte value.
setFeePerBytesetFeePerByte(uint256)void❌Updates embedded policy state; committee authorization is not modeled.
getExecFeeFactorgetExecFeeFactor()uint32✅Returns current embedded execution fee factor.
setExecFeeFactorsetExecFeeFactor(uint32)void❌Updates embedded execution fee factor.
getExecPicoFeeFactorgetExecPicoFeeFactor()uint256✅Returns execution fee factor scaled to picoGAS.
getStoragePricegetStoragePrice()uint256✅Returns current embedded storage price.
setStoragePricesetStoragePrice(uint256)void❌Updates embedded storage price.
getMillisecondsPerBlockgetMillisecondsPerBlock()uint256✅Returns current embedded milliseconds-per-block value.
setMillisecondsPerBlocksetMillisecondsPerBlock(uint256)void❌Updates embedded milliseconds-per-block value.
getMaxValidUntilBlockIncrementgetMaxValidUntilBlockIncrement()uint256✅Returns current embedded max valid-until-block increment.
setMaxValidUntilBlockIncrementsetMaxValidUntilBlockIncrement(uint256)void❌Updates embedded max valid-until-block increment.
getMaxTraceableBlocksgetMaxTraceableBlocks()uint256✅Returns current embedded max traceable blocks value.
setMaxTraceableBlockssetMaxTraceableBlocks(uint256)void❌Updates embedded max traceable blocks value.
getAttributeFeegetAttributeFee(uint8)uint256✅Reads fee for the requested attribute type, defaulting to zero.
setAttributeFeesetAttributeFee(uint8,uint256)void❌Updates embedded attribute-fee map.
isBlockedisBlocked(address)bool✅Checks embedded blocked-account set.
blockAccountblockAccount(address)bool❌Adds non-empty account to embedded blocked-account set.
unblockAccountunblockAccount(address)bool❌Removes account from embedded blocked-account set.
getBlockedAccountsgetBlockedAccounts()iterator/array✅Devpack exposes an iterator wrapper; embedded runtime returns an array of blocked accounts.
setWhitelistFeeContractsetWhitelistFeeContract(address,string,uint8,uint256)void❌Adds an embedded whitelist-fee contract entry.
removeWhitelistFeeContractremoveWhitelistFeeContract(address,string,uint8)void❌Removes embedded entries matching the contract hash.
getWhitelistFeeContractsgetWhitelistFeeContracts()iterator/array✅Devpack exposes an iterator wrapper; embedded runtime returns an array of entries.
recoverFundrecoverFund(address,address)bool❌Embedded runtime is a no-op that returns true.

Code Example ​

solidity
import "devpack/contracts/NativeCalls.sol";

contract FeeEstimator {
    function estimateStorageCost(uint256 bytesCount) public view returns (uint256) {
        uint256 pricePerByte = NativeCalls.getStoragePrice();
        return pricePerByte * bytesCount;
    }

    function getNetworkFeeParams() public view returns (uint256 feePerByte, uint32 execFactor) {
        feePerByte = NativeCalls.getFeePerByte();
        execFactor = NativeCalls.getExecFeeFactor();
    }

    function requireNotBlocked(address account) internal view {
        require(!NativeCalls.isBlocked(account), "account is blocked");
    }
}

MIT Licensed