本文定义了一组 Provider 方法,这些方法用来定义 DApp (Decentralized Application) 如何与 CKB 区块链的节点之间进行交互。
为防止不同的 Provider 定义不同的方法名称,导致定义和交互方式的碎片化,我们希望通过这个文档定义一组通用的 Provider 方法。
| pragma solidity ^0.4.18; | |
| contract D { | |
| uint public realN; | |
| address public realSender; | |
| function delegatecallSetN(address _e, uint _n) public { | |
| _e.delegatecall(bytes4(keccak256("setN(uint256)")), _n); // D's storage is set, E is not modified | |
| } | |
| } |
| /** | |
| *Submitted for verification at Etherscan.io on 2017-12-12 | |
| */ | |
| // Copyright (C) 2015, 2016, 2017 Dapphub | |
| // This program is free software: you can redistribute it and/or modify | |
| // it under the terms of the GNU General Public License as published by | |
| // the Free Software Foundation, either version 3 of the License, or | |
| // (at your option) any later version. |
| // File: contracts/zeppelin/upgradable/Initializable.sol | |
| pragma solidity >=0.4.24 <0.6.0; | |
| /** | |
| * @title Initializable | |
| * | |
| * @dev Helper contract to support initializer functions. To use it, replace |
| abstract class Dough { | |
| } | |
| class ThinDough extends Dough { | |
| } | |
| class ThickDough extends Dough { | |
| } |
ckb-rich-node RPC base on ckb-rpc and ckb-indexer-rpc.
Both RPCs are JSON-RPC protocol, more information can refer to ckb-rich-node.
| yarn run v1.17.3 | |
| $ ./scripts/start-worker.sh watcher affirmation-request-watcher | |
| [1568900257870] INFO (watcher-native-erc-affirmation-request): Connected to redis | |
| [1568900257888] DEBUG (watcher-native-erc-affirmation-request): Last Processed block obtained | |
| fromRedis: "13596650" | |
| fromConfig: "13588055" | |
| [1568900257909] INFO (watcher-native-erc-affirmation-request): Connected to amqp Broker | |
| [1568900258891] DEBUG (watcher-native-erc-affirmation-request): Getting block number | |
| module: "web3" | |
| [1568900258894] DEBUG (watcher-native-erc-affirmation-request): Getting required block confirmations |
| Verifying my Blockstack ID is secured with the address 126aVHrFrwL6Y9jFBnTugnYt9Fb82yG5be https://explorer.blockstack.org/address/126aVHrFrwL6Y9jFBnTugnYt9Fb82yG5be |
| pragma solidity ^0.4.25; | |
| contract Donation { | |
| uint fundLimit = 1 ether; | |
| address owner; | |
| event fundMoved(address _to, uint _amount); | |
| modifier onlyowner { if (msg.sender == owner) _; } | |
| address[] _giver; | |
| uint[] _values; |
| pragma solidity ^0.4.24; | |
| /** | |
| * @title -FoMo-3D v0.7.1 | |
| * ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐ | |
| * │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐ | |
| * ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘ | |
| * _____ _____ | |
| * (, / /) /) /) (, / /) /) | |
| * ┌─┐ / _ (/_ // // / _ // _ __ _(/ | |
| * ├─┤ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_ |