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
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { | |
uint cnt = _receivers.length; | |
uint256 amount = uint256(cnt) * _value; | |
require(cnt > 0 && cnt <= 20); | |
require(_value > 0 && balances[msg.sender] >= amount); | |
balances[msg.sender] = balances[msg.sender].sub(amount); | |
for (uint i = 0; i < cnt; i++) { | |
balances[_receivers[i]] = balances[_receivers[i]].add(_value); | |
Transfer(msg.sender, _receivers[i], _value); |
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
function random() private view returns (uint8) { | |
return uint8(uint256(keccak256(block.timestamp, block.difficulty))%251); | |
} |
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
function f( blocknumber, to_address, value_) { | |
var filter = web3.eth.filter('latest').watch( | |
function(err, blockHash) { | |
var target=blocknumber; | |
if(web3.eth.blockNumber==target) { | |
filter.stopWatching(); // your function here | |
web3.eth.sendTransaction({to:to_address, from:web3.eth.coinbase, value: web3.toWei(value_,"ether")}); | |
filter = null; |
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
new HelloWorld in { | |
contract HelloWorld(return) = { | |
return!("Hello, World!") | |
} | | |
new myChannel in { | |
HelloWorld!(*myChannel) | |
} | |
} |
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
new HelloAgain in { | |
contract HelloAgain(_) = { | |
new chan in { | |
chan!("Hello again, world!") | | |
for (@text <- chan) { Nil } | |
} | |
} | HelloAgain!(Nil) | |
} |
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
contract Token( message_sender, total_supply ) { | |
def transfer( message_sender, to, amount, rtn ) = { | |
for( balances <- balances_channel ) { | |
x!( *balances.get(message_sender) ) | |
| y!( *balances.get(to) ) | |
| for( balance_of_sender <- x ; balances_of_receiver <- y ) { |
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
initializeBounty(address _controller, string _data) | |
fulfillBounty(address[] _fulfillers, uint[] _numerators, uint _denomenator, string _data) | |
acceptFulfillment(uint _fulfillmentId, StandardToken[] _payoutTokens, uint[] _tokenAmounts) | |
drainBounty(StandardToken[] _payoutTokens) | |
changeBounty(address _controller, string _data) |
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import "./styles.css"; | |
class IndecisionApp extends React.Component { | |
constructor(props) { | |
super(props); | |
this.handleDeleteOptions = this.handleDeleteOptions.bind(this); |
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
[ | |
{ | |
"name": "carCollection", | |
"policy": "OR ('Org1MSP.member','Org2MSP.member')", | |
"requiredPeerCount": 0, | |
"maxPeerCount": 3, | |
"blockToLive":1000000 | |
} | |
] |
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
async createCar(stubHelper: StubHelper, args: string[]) { | |
const verifiedArgs = await Helpers.checkArgs<any>(args[0], Yup.object() | |
.shape({ | |
key: Yup.string().required(), | |
make: Yup.string().required(), | |
model: Yup.string().required(), | |
color: Yup.string().required(), | |
owner: Yup.string().required(), | |
})); |