TwoKeyCampaignConversionHandler
contract TwoKeyCampaignConversionHandler
Index
- ConversionCreated
- approveConverter
- calculateModeratorFee
- getAddressFromTwoKeySingletonRegistry
- getAllConvertersPerState
- getCampaignSummary
- getConverterConversionIds
- getLastConverterConversionId
- getNumberOfConversions
- getStateForConverter
- moveFromPendingOrRejectedToApprovedState
- moveFromPendingToRejectedState
- moveFromStateAToStateB
- onlyContractorOrMaintainer
- rejectConverterInternal
Reference
Events
ConversionCreated
event ConversionCreated(uint conversionId)- Parameters:
conversionId- uint
Modifiers
onlyContractorOrMaintainer
modifier onlyContractorOrMaintainer()
Functions
approveConverter
function approveConverter(address _converter) publicOnly maintainer or contractor can call this method, Function where we are approving converter.
- Modifiers:
- onlyContractorOrMaintainer
- Parameters:
_converter- is the address of converter
calculateModeratorFee
function calculateModeratorFee(uint256 _conversionAmountETHWei) internal view returns (uint256)Given the total payout, calculates the moderator fee.
- Parameters:
_conversionAmountETHWei- total payout for escrow- Returns:
- moderator fee
getAddressFromTwoKeySingletonRegistry
function getAddressFromTwoKeySingletonRegistry(string contractName) internal view returns (address)- Parameters:
contractName- string- Returns:
- address
getAllConvertersPerState
function getAllConvertersPerState(bytes32 state) public view returns (address[])- Parameters:
state- bytes32- Returns:
- address[]
getCampaignSummary
function getCampaignSummary() public view returns (uint, uint, uint, uint[])Get's number of converters per type, and returns tuple, as well as total raised funds.
- Returns:
- uint
- uint
- uint
- uint[]
getConverterConversionIds
function getConverterConversionIds(address _converter) public view returns (uint[])Can only be called by converter itself or maintainer/contractor, Function to get all conversion ids for the converter.
- Parameters:
_converter- is the address of the converter- Returns:
- array of conversion ids
getLastConverterConversionId
function getLastConverterConversionId(address _converter) public view returns (uint)- Parameters:
_converter- address- Returns:
- uint
getNumberOfConversions
function getNumberOfConversions() external view returns (uint)Can only be called by contractor or maintainer, Function to get number of conversions.
- Returns:
- uint
getStateForConverter
function getStateForConverter(address _converter) external view returns (bytes32)Function to get converter state.
- Parameters:
_converter- is the address of the requested converter- Returns:
- hexed string of the state
moveFromPendingOrRejectedToApprovedState
function moveFromPendingOrRejectedToApprovedState(address _converter) internalConverter can only be approved if his previous state is pending or rejected, Function where we can change state of converter to Approved.
- Parameters:
_converter- is the address of converter
moveFromPendingToRejectedState
function moveFromPendingToRejectedState(address _converter) internalPrivate function, will be executed in another one, Function where we're going to move state of conversion from pending to rejected.
- Parameters:
_converter- is the address of converter
moveFromStateAToStateB
function moveFromStateAToStateB(address _converter, bytes32 destinationState) internalFunction to move converter address from stateA to stateB.
- Parameters:
_converter- is the address of converterdestinationState- is the state we'd like to move converter to
rejectConverterInternal
function rejectConverterInternal(address _converter) internal- Parameters:
_converter- address