9 define(
'IS_PUBLIC', TRUE);
11 require_once __DIR__ .
'/examples.inc.php';
14 <h3>Example: Register Drupal</h3>
16 <a href=
"https://github.com/digitaldonkey/register_drupal_ethereum">Smart contract</a>
17 is <a href=
"https://kovan.etherscan.io/address/0xdacb85f3a6f12ca7893f887f875064880ce14d7d">deployed at</a>
21 It is a simple registry, where user <em>submit</em> a Hash provided by the CMS to a registry.
22 Imagine the registry a a simple array.
25 The <b>validateUserByHash(hash)</b>
function returns the submitting user address.
34 $exampleHash =
"0x6139633364613535613365333161396433353334353934376261323439353232";
48 "stateMutability": "nonpayable", 55 "name": "drupalUserHash", 59 "name": "validateUserByHash", 67 "stateMutability": "view", 89 "name": "AccountCreatedEvent", 108 "name": "accountCreated", 111 "stateMutability": "nonpayable", 118 "name": "drupalUserHash", 125 "stateMutability": "nonpayable", 131 "name": "contractExists", 139 "stateMutability": "pure", 146 "name": "registrationDisabled", 150 "name": "adminSetRegistrationDisabled", 153 "stateMutability": "nonpayable", 160 "name": "accountAdmin", 164 "name": "adminSetAccountAdministrator", 167 "stateMutability": "nonpayable", 173 "name": "adminRetrieveDonations", 176 "stateMutability": "nonpayable", 182 "name": "adminDeleteRegistry", 185 "stateMutability": "nonpayable", 192 $eth =
new Ethereum(
'https://kovan.infura.io/drupal');
203 echo
"<p style='color: forestgreen;'>The Address submitted this hash is:<br />";
204 echo
$test->hexVal().
"</p>";
208 echo
"<p style='color: red;'>We have a problem:<br />";
209 echo $exception->getMessage() .
"</p>";
210 echo
"<pre>" . $exception->getTraceAsString() .
"</pre>";