This file contains hidden or 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
uint256 currentBalance; | |
function pay(uint256 amount) public { | |
require(amount > 0, "amount is not bigger than zero"); | |
uint256 currentBalance = 10; | |
currentBalance = currentBalance.add(amount); | |
} |
This file contains hidden or 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
/* | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
*/ | |
pragma solidity >=0.4.25 <0.6.0; |
This file contains hidden or 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
pragma solidity >= 0.4.25 < 0.6.0; | |
library SafeMath { | |
struct Balance { uint256 _balance; } | |
function add(Num storage self, uint256 amount) public { | |
uint256 newBalance = self._ balance + amount; | |
require(newBalance >= self._ balance, "addition overflow"); | |
self._ balance = newBalance; |
This file contains hidden or 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
pragma solidity >= 0.4.25 < 0.6.0; | |
library SafeMath { | |
function add(uint256 a, uint256 b) public pure returns (uint256){ | |
uint256 c = a + b; | |
require(c >= a, "SafeMath: addition overflow"); | |
return c; | |
} |
This file contains hidden or 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
pragma solidity >= 0.4.25 < 0.6.0; | |
import '../node_modules/openzeppelin solidity/contracts/ownership/Ownable.sol'; | |
import '../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol'; | |
import './AddrArrayLib.sol'; | |
contract TokenContract is Ownable { | |
using AddrArrayLib for AddrArrayLib.Addresses; | |
using SafeMath for uint256; | |
This file contains hidden or 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
x-quorum-def: | |
&quorum-def | |
restart: "on-failure" | |
image: "${QUORUM_DOCKER_IMAGE:-quorumengineering/quorum:2.3.0}" | |
expose: | |
- "21000" | |
- "50400" | |
healthcheck: | |
test: ["CMD", "wget", "--spider", "--proxy", "off", "http://localhost:8545"] | |
interval: 4s |
This file contains hidden or 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
services: | |
node1: | |
<< : *quorum-def | |
hostname: node1 | |
ports: | |
- "22000:8545" | |
volumes: | |
- vol1:/qdata | |
- ./3nodes:/3nodes:ro | |
environment: |
This file contains hidden or 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
# QUORUM_DOCKER_IMAGE: default to quorumengineering/quorum:2.3.0 | |
# To use Remix, set QUORUM_GETH_ARGS="--rpccorsdomain https://remix.ethereum.org" | |
version: "3.6" | |
x-quorum-def: | |
&quorum-def | |
restart: "on-failure" | |
image: "${QUORUM_DOCKER_IMAGE:-quorumengineering/quorum:2.3.0}" | |
expose: | |
- "21000" | |
- "50400" |
This file contains hidden or 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
# use the 'node' official image | |
FROM node:8.16.2-alpine3.9 | |
# expose ports 7545, 7546, 7547 | |
EXPOSE 7545 | |
EXPOSE 7546 | |
EXPOSE 7547 | |
# use alpine package manager to install git | |
RUN apk add --no-cache git |
This file contains hidden or 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
proxy: | |
restart: "on-failure" | |
build: | |
context: . | |
ports: | |
- "22003:7545" | |
- "22004:7546" | |
- "22005:7547" | |
networks: | |
quorum-simple-net: |