CertifierHandler.sol
contract CertifierHandler
is Ownable
This contract can be used by certified people to change their certification address. How it works: 1. A trasaction must be sent from the first certified address, which will contain as argument the new address to certify 2. An event is emitted by the contract, which a process will listen to. It will immediately call `revoke(old_address)` and then `certify(new_address)` in order change the certification address. 3. The certifier account calls `settle` so that the entry is deleted from this contract. A small fee will be asked in order to pay for the transaction costs (3 transactions are sent). After the modification of the certified address, the sender and the new account are both locked. This is to prevent people change constantly their certified address.Source: DutchAuction/CertifierHandler.solAuthor: Nicolas Gotchac <nicolas@parity.io>
Index
Reference
Events
Drained
event
Drained
(uint _balance)
EVENTS.Parameters:
_balance
- uintLocked
event
Locked
(address _who)
Parameters:
_who
- addressNewFee
event
NewFee
(uint _oldFee, uint _newFee)
Parameters:
_oldFee
- uint_newFee
- uintNewTreasury
event
NewTreasury
(address _oldTreasury, address _newTreasury)
Parameters:
_oldTreasury
- address_newTreasury
- addressRequested
event
Requested
(address _sender, address _who)
Parameters:
_sender
- address_who
- addressTransfered
event
Transfered
(address _sender, address _who, address _certifier)
Parameters:
_sender
- address_who
- address_certifier
- address
Modifiers
only_unlocked
modifier
only_unlocked
(address _who)
MODIFIERS.Parameters:
_who
- address
Functions
claim
function
claim
(address who) public payable
PUBLIC METHODS, This method will be called by certified accounts that which to certify another address. This function can only be called once per user. After a successful re-certification, these two accounts are locked, and cannot ask for another re-certification.Modifiers:only_unlocked only_unlockedParameters:
who
- The address to which the certification should be transfereddrain
function
drain
() external
RESTRICTED (owner or delegate only) PUBLIC METHODS, Send the current balance to the treasury. Could be needed if value is sent outside of the `claim` method (eg. contract suicide).Modifiers:onlyOwner
fallback
function (address _certifier, address _treasury) public
CONSTRUCTOR, Contructor method of the contract, which will set the `certifier` address.Parameters:
_certifier
- The address of the main certifier_treasury
- The address of the treasurysetFee
function
setFee
(uint _fee) external
Change the fee, needed if for whatever reason gas price must be modified. Only the owner of the contract can execute this method.Modifiers:onlyOwnerParameters:
_fee
- The new feesetLocked
function
setLocked
(address _who) external
The owner can lock an account, which is basically a blacklist. This shouldn't be used often ; but could be useful for re-deployment of new contract for example.Modifiers:onlyOwnerParameters:
_who
- The account to lock.setTreasury
function
setTreasury
(address _treasury) external
Change the address of the treasury, the address to which the payments are forwarded to. Only the owner of the contract can execute this method.Modifiers:onlyOwnerParameters:
_treasury
- The new treasury addresssettle
function
settle
(address sender) public
This method is called by the certifier account in order to remove the pending request of modification of the certified address. Anyone can call this method, since it checks that the pending request has actually gone through (modification of certification address).Parameters:
sender
- address
Last updated
Was this helpful?