Shared

This document is better viewed at https://docs.etherisc.com/contracts/api/shared

Contracts

CoreController

import "@etherisc/gif-contracts/contracts/shared/CoreController.sol";
Events
Initializable

onlyInstanceOperator() modifier

onlyPolicyFlow(bytes32 module) modifier

constructor() public

Constructor function that disables initializers.

initialize(address registry) public

Initializes the contract with the provided registry address.

_getName() → bytes32 internal

Returns the name of the contract.

_afterInitialize() internal

This function is called after the contract is initialized and can be used to perform additional setup.

_getContractAddress(bytes32 contractName) → address contractAddress internal

Returns the address of a registered contract by its name.

CoreProxy

import "@etherisc/gif-contracts/contracts/shared/CoreProxy.sol";
Modifiers

onlyAdmin() modifier

constructor(address _controller, bytes encoded_initializer) public

Constructor function that creates a new instance of the contract.

implementation() → address external

Returns the address of the current implementation contract.

upgradeToAndCall(address newImplementation, bytes data) external

Upgrades the contract to a new implementation and forwards a function call to it.

TransferHelper

import "@etherisc/gif-contracts/contracts/shared/TransferHelper.sol";

unifiedTransferFrom(contract IERC20 token, address from, address to, uint256 value) → bool success internal

Executes a transferFrom function call on an ERC20 token contract, after performing input validation.

LogTransferHelperInputValidation1Failed(bool tokenIsContract, address from, address to) event

LogTransferHelperInputValidation2Failed(uint256 balance, uint256 allowance) event

LogTransferHelperCallFailed(bool callSuccess, uint256 returnDataLength, bytes returnData) event

WithRegistry

import "@etherisc/gif-contracts/contracts/shared/WithRegistry.sol";

onlyInstanceOperator() modifier

onlyOracleService() modifier

onlyOracleOwner() modifier

onlyProductOwner() modifier

constructor(address _registry) public

Constructor function that sets the address of the registry contract.

getContractFromRegistry(bytes32 _contractName) → address _addr public

Returns the address of a contract registered in the registry by its name.

getContractInReleaseFromRegistry(bytes32 _release, bytes32 _contractName) → address _addr internal

Returns the address of a contract with a given name in a specific release of the registry.

getReleaseFromRegistry() → bytes32 _release internal

Returns the current release identifier from the registry.