Documentation
¶
Index ¶
- Constants
- Variables
- func ABI(contractName string, version uint8) abi.ABI
- func ABIPack(contractName string, version uint8, method string, args ...interface{}) ([]byte, error)
- func GetContractAddress(contractName string, version uint8) common.Address
- func GetContractAddressByConfig(contractName string, blockNum *big.Int, config *params.ChainConfig) common.Address
- func GetContractVersion(contractName string, blockNum *big.Int, config *params.ChainConfig) uint8
- type ContractInfo
- type SysContractVersion
Constants ¶
View Source
const ( // SystemInteractiveABI contains all methods to interactive with system contracts. SystemInteractiveABI = `` /* 3777-byte string literal not displayed */ OnChainDaoInteractiveABI = `` /* 2954-byte string literal not displayed */ CommunityPoolInteractiveABI = `` /* 247-byte string literal not displayed */ AddrListInteractiveABI = `` /* 1351-byte string literal not displayed */ )
View Source
const ( SysContractName = "SystemContract" OnChainDaoContractName = "OnChainDaoContract" AddressListContractName = "AddressListContract" CommunityPoolContractName = "CommunityPoolContract" )
View Source
const ( ContractV0 = iota // 0 ContractV1 // 1 ContractV2 // 2 ContractV3 // 3 ContractV4 // 4 ContractV5 // 5 )
View Source
const DevMappingPosition = 2
DevMappingPosition is the position of the state variable `devs`. Since the state variables are as follows:
bool public initialized; bool public devVerifyEnabled; bool public checkInnerCreation; address public admin; address public pendingAdmin; mapping(address => bool) private devs; //NOTE: make sure this list is not too large! address[] blacksFrom; address[] blacksTo; mapping(address => uint256) blacksFromMap; // address => index+1 mapping(address => uint256) blacksToMap; // address => index+1 uint256 public blackLastUpdatedNumber; // last block number when the black list is updated uint256 public rulesLastUpdatedNumber; // last block number when the rules are updated // event check rules EventCheckRule[] rules; mapping(bytes32 => mapping(uint128 => uint256)) rulesMap; // eventSig => checkIdx => indexInArray+1
according to [Layout of State Variables in Storage](https://docs.soliditylang.org/en/v0.8.4/internals/layout_in_storage.html), and after optimizer enabled, the `initialized`, `devVerifyEnabled`, `checkInnerCreation` and `admin` will be packed, and stores at slot 0, `pendingAdmin` stores at slot 1, so the position for `devs` is 2.
Variables ¶
View Source
var ( BlackLastUpdatedNumberPosition = common.BytesToHash([]byte{0x07}) RulesLastUpdatedNumberPosition = common.BytesToHash([]byte{0x08}) )
View Source
var ( MaxValidators = uint8(21) MinSelfStake = big.NewInt(100) LocalAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") )
View Source
var ( SystemContract = common.HexToAddress("0x000000000000000000000000000000000000F000") OnChainDaoContract = common.HexToAddress("0x000000000000000000000000000000000000F001") AddressListContract = common.HexToAddress("0x000000000000000000000000000000000000F002") CommunityPoolContract = common.HexToAddress("0x000000000000000000000000000000000000F003") )
View Source
var (
AdminForDevelopChain common.Address
)
Functions ¶
func ABIPack ¶
func ABIPack(contractName string, version uint8, method string, args ...interface{}) ([]byte, error)
ABIPack generates the data field for given contract calling
func GetContractAddress ¶
func GetContractVersion ¶
Types ¶
type ContractInfo ¶
type ContractInfo struct {
// contains filtered or unexported fields
}
type SysContractVersion ¶
type SysContractVersion int
const ( GenesisVersion SysContractVersion = iota EarthVersion )
func GetSysContractVersion ¶
func GetSysContractVersion(blockNum *big.Int, config *params.ChainConfig) SysContractVersion
Click to show internal directories.
Click to hide internal directories.