AlertSourceDiscuss
Skip to content

ERC-801: Canary Standard

🚧 StagnantERC

Stagnant

This EIP has had no recent activity for at least 6 months, and has automatically been marked as stagnant. This EIP should not be used in production.

If you are interested in helping move this EIP to final, create a PR to move this EIP back to Draft and add yourself as an author, and an EIP editor will help guide you through the process. Thank you!

Authorsligi <ligi@ligi.de>
Created2017-12-16

Simple Summary ​

A standard interface for canary contracts.

Abstract ​

The following standard allows the implementation of canaries within contracts. This standard provides basic functionality to check if a canary is alive, keeping the canary alive and optionally manage feeders.

Motivation ​

The canary can e.g. be used as a warrant canary. A standard interface allows other applications to easily interface with canaries on Ethereum - e.g. for visualizing the state, automated alarms, applications to feed the canary or contracts (e.g. insurance) that use the state.

Specification ​

Methods ​

isAlive() ​

Returns if the canary was fed properly to signal e.g. that no warrant was received.

js
function isAlive() constant returns (bool alive)

getBlockOfDeath() ​

Returns the block the canary died. Throws if the canary is alive.

js
function getBlockOfDeath() constant returns (uint256 block)

getType() ​

Returns the type of the canary:

  • 1 = Simple (just the pure interface as defined in this ERC)
  • 2 = Single feeder (as defined in ERC-TBD)
  • 3 = Single feeder with bad food (as defined in ERC-TBD)
  • 4 = Multiple feeders (as defined in ERC-TBD)
  • 5 = Multiple mandatory feeders (as defined in ERC-TBD)
  • 6 = IOT (as defined in ERC-TBD)

1 might also be used for a special purpose contract that does not need a special type but still wants to expose the functions and provide events as defined in this ERC.

js
function getType() constant returns (uint8 type)

Events ​

RIP ​

MUST trigger when the contract is called the first time after the canary died.

js
event RIP()

Implementation ​

TODO

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

ligi, "ERC-801: Canary Standard[DRAFT]," Ethereum Improvement Proposals, no. 801, 2017. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-801.