- web3
- web3.version.api
- web3.version.node
- web3.version.network
- web3.version.ethereum
- web3.version.whisper
- web3.isConnected
- web3.setProvider
- web3.currentProvider
- web3.reset
- web3.sha3
- web3.toHex
- web3.toAscii
- web3.fromAscii
- web3.toDecimal
- web3.fromDecimal
- web3.fromWei
- web3.toWei
- web3.toBigNumber
- web3.net.listening
- web3.net.peerCount
- web3.eth
- web3.eth.defaultAccount
- web3.eth.defaultBlock
- web3.eth.syncing
- web3.eth.isSyncing
- web3.eth.coinbase
- web3.eth.mining
- web3.eth.hashrate
- web3.eth.gasPrice
- web3.eth.accounts
- web3.eth.blockNumber
- web3.eth.register
- web3.eth.unRegister
- web3.eth.getBalance
- web3.eth.getStorageAt
- web3.eth.getCode
- web3.eth.getBlock
- web3.eth.getBlockTransactionCount
- web3.eth.getUncle
- web3.eth.getTransaction
- web3.eth.getTransactionFromBlock
- web3.eth.getTransactionReceipt
- web3.eth.getTransactionCount
- web3.eth.sendTransaction
- web3.eth.sendRawTransaction
- web3.eth.sign
- web3.eth.call
- web3.eth.estimateGas
- web3.eth.filter
- web3.eth.contract
- web3.eth.getCompilers
- web3.eth.compile.solidity
- web3.eth.compile.lll
- web3.eth.compile.serpent
- web3.eth.namereg
- web3.db.putString
- web3.db.getString
- web3.db.putHex
- web3.db.getHex
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
web3.eth.compile.solidity
web3.eth.compile.solidity(sourceString [, callback])
编译Solidity源代码。
参数:
String
- Solidity源代码。Function
-(可选)回调函数,用于支持异步的方式执行[async]。
返回值:
Object
- 合约和编译信息。
示例:
var source = "" +
"contract test {\n" +
" function multiply(uint a) returns(uint d) {\n" +
" return a * 7;\n" +
" }\n" +
"}\n";
var compiled = web3.eth.compile.solidity(source);
console.log(compiled);
// {
"test": {
"code": "0x605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056",
"info": {
"source": "contract test {\n\tfunction multiply(uint a) returns(uint d) {\n\t\treturn a * 7;\n\t}\n}\n",
"language": "Solidity",
"languageVersion": "0",
"compilerVersion": "0.8.2",
"abiDefinition": [
{
"constant": false,
"inputs": [
{
"name": "a",
"type": "uint256"
}
],
"name": "multiply",
"outputs": [
{
"name": "d",
"type": "uint256"
}
],
"type": "function"
}
],
"userDoc": {
"methods": {}
},
"developerDoc": {
"methods": {}
}
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论