I hope we didn't unleash a beast.
A decentralized social media web application based on Ethereum platform.
基于以太坊的去中心化社交程序。
// this file is an example of calling other contracts | |
pragma solidity ^0.4.0; | |
contract Test { | |
mapping (string => uint) data; | |
address public previousContractAddress; | |
Test previousContract; | |
constructor(address previousContractAddress_) public { |
iele_sendTransaction
and iele_call
:➜ mantis-1.0-daedalus-rc1 curl -XPOST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"personal_unlockAccount", "params": ["654510a4a13393d9aed326c86bc84df2d5fcfbbf", "4rfv5tgB"], "id": 4}' localhost:8546
{"jsonrpc":"2.0","result":true,"id":4}%
➜ mantis-1.0-daedalus-rc1 curl -XPOST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"iele_sendTransaction", "params": [{"from":"654510a4a13393d9aed326c86bc84df2d5fcfbbf", "gasPrice":5000000000, "gasLimit": 1000000, "contractCode": "0x0000004C6303690009666163746F7269616C6800010001618001100042650003026101036600006180011200446500020466000102001B610101030040640000660002F6000103660003FE6700000000", "arguments": []}], "id": 3}' localhost:8546
{"jsonrpc":"2.0","result":"0xb696754c82cc75b2d361b5180fc7f86846c1d54d48c907
(function(args={}) { // event = {url, cheerio, $get} | |
return new Promise((resolve, reject)=> { | |
const name = args['name'] | |
const url = encodeURI(`http://www.fixsub.com/portfolio/${name}`) | |
request.get({ | |
url, | |
headers: { | |
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36' | |
} | |
}, function(error, response, body) { |
const url = require("url"); | |
const BASE = "https://staging.iele.dev-mantis.iohkdev.io"; | |
function resolveApiUrl(relativeUrl) { | |
if (location.hostname.match(/localhost|127\.0\.0\.1/)) { | |
return url.resolve(BASE, relativeUrl); | |
} else { | |
return relativeUrl; | |
} | |
} |
const fs = require('fs'), | |
path = require('path') | |
function spaceAhead(n) { | |
let outputString = '' | |
for (let i = 0; i < n; i++) { | |
outputString += ' ' | |
} | |
return outputString | |
} |
// https://stackoverflow.com/questions/21647928/javascript-unicode-string-to-hex?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa | |
String.prototype.hexDecode = function(){ | |
var j; | |
var hexes = this.match(/.{1,4}/g) || []; | |
var back = ""; | |
for(j = 0; j<hexes.length; j++) { | |
back += String.fromCharCode(parseInt(hexes[j], 16)); | |
} |