-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add counter contract * add counter contract * add dds statistic * add dds statistic (#1353) * add dds statistic
- Loading branch information
1 parent
36742c9
commit 86dede2
Showing
19 changed files
with
405 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# transfer okt | ||
# how to use | ||
``` | ||
./run.sh | ||
go build | ||
./client | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[ | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "counter", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Added", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "counter", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Changed", | ||
"type": "event" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "delta", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "add", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "getCounter", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [], | ||
"name": "subtract", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
60806040526000805534801561001457600080fd5b50610289806100246000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631003e2d2146100465780636deebae3146100745780638ada066e1461007e575b600080fd5b6100726004803603602081101561005c57600080fd5b810190808035906020019092919050505061009c565b005b61007c61011c565b005b61008661024b565b6040518082815260200191505060405180910390f35b80600054016000819055507f64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee360619416000546040518082815260200191505060405180910390a17f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040518082815260200191505060405180910390a150565b60008054116040518060400160405280600f81526020017f434f554e5445525f544f4f5f4c4f570000000000000000000000000000000000815250906101fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156101c25780820151818401526020810190506101a7565b50505050905090810190601f1680156101ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000808154809291906001900391905055507f938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b8296000546040518082815260200191505060405180910390a1565b6000805490509056fea265627a7a72315820c6f3b99c79c6b8f58139949ba74a7935659433d5296a69d6e828e5aab1c52d0864736f6c63430005110032 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pragma solidity ^0.5.11; | ||
|
||
contract Counter { | ||
uint256 counter = 0; | ||
string internal constant ERROR_TOO_LOW = "COUNTER_TOO_LOW"; | ||
event Changed(uint256 counter); | ||
event Added(uint256 counter); | ||
|
||
function add(uint256 delta) public { | ||
counter = counter + delta; | ||
emit Added(counter); | ||
emit Changed(counter); | ||
} | ||
|
||
function subtract() public { | ||
require(counter > 0, ERROR_TOO_LOW); | ||
counter--; | ||
emit Changed(counter); | ||
} | ||
|
||
function getCounter() public view returns (uint256) { | ||
return counter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
module github.com/okex/exchain/dev/client | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect | ||
github.com/allegro/bigcache v1.2.1 // indirect | ||
github.com/btcsuite/btcd v0.21.0-beta // indirect | ||
github.com/cespare/cp v1.1.1 // indirect | ||
github.com/cosmos/cosmos-sdk v0.39.2 | ||
github.com/deckarep/golang-set v1.7.1 // indirect | ||
github.com/ethereum/go-ethereum v1.10.8 | ||
github.com/go-ole/go-ole v1.2.4 // indirect | ||
github.com/kr/pretty v0.2.0 // indirect | ||
github.com/okex/exchain-ethereum-compatible v1.0.2 | ||
github.com/prometheus/tsdb v0.9.1 // indirect | ||
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 // indirect | ||
) | ||
|
||
replace github.com/cosmos/cosmos-sdk => github.com/okex/cosmos-sdk v0.39.2-exchain1 |
Oops, something went wrong.