Ethereum
有人可以向我展示一個相當於乙太坊智能合約的範例砧木智能合約嗎?
來自乙太坊,是否有與乙太坊智能合約程式碼等效的範例砧木智能合約程式碼?
當您是solidity 開發人員時,您可以使用solidity 編寫任何合約並對其進行編譯,然後使用RSK控制台將其直接發佈到RSK Smart 網路,或者使用RPC 呼叫,例如:
curl -X POST --data ' { "jsonrpc" : "2.0", "method" : "eth_sendTransaction", "params" : [{ "from" : "0x9e54691b45abfe4552cb03a8247a8da8a3c43d32", "data" : "6060604052341561000f57600080fd5b5b6102de8061001f6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634ed3885e146100495780636d4ce63c146100a6575b600080fd5b341561005457600080fd5b6100a4600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610135565b005b34156100b157600080fd5b6100b9610150565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fa5780820151818401525b6020810190506100de565b50505050905090810190601f1680156101275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b806000908051906020019061014b9291906101f9565b505b50565b610158610279565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156101ee5780601f106101c3576101008083540402835291602001916101ee565b820191906000526020600020905b8154815290600101906020018083116101d157829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061023a57805160ff1916838001178555610268565b82800160010185558215610268579182015b8281111561026757825182559160200191906001019061024c565b5b509050610275919061028d565b5090565b602060405190810160405280600081525090565b6102af91905b808211156102ab576000816000905550600101610293565b5090565b905600a165627a7a723058204a448cae7e610906fd5c361ed16ff76c82633a993ea4444b38f8498686a3ea4c0029" } ], "id" : 1 }’ http://<RSKNode>:<RSKNodePort>
字節碼可以從solidity瀏覽器或使用solc獲取。
編輯:您可以配置Remix或 truffle 以連接到 RSK 節點並直接部署您的智能合約