'use strict';
var SampleContract = function () {
};
SampleContract.prototype = {
init: function () {
},
set: function (name, value) {
// 存储字符串
LocalContractStorage.set("name",name);
// 存储数字
LocalContractStorage.set("value", value);
// 存储对象
LocalContractStorage.set("obj", {name:name,value:value});
},
get: function () {
var name = LocalContractStorage.get("name");
console.log("name:"+name)
var value = LocalContractStorage.get("value");
console.log("value:"+value)
var obj = LocalContractStorage.get("obj");
console.log("obj:"+JSON.stringify(obj))
},
del: function () {
var result = LocalContractStorage.del("name");
console.log("del result:"+result)
}
};
module.exports = SampleContract;
The contract address is n1ziQ1AnhMjm5qXxXVM7gRujW8qGRAf9PbE. And I have call set("ddd", "eee") in transaction 7d2637a48672227ab7c48d73705110aeb72f52f5f6186ba15e03f6e9d4154a48. However, when I call get, no results are returned.
I have followed the tutorial https://github.com/nebulasio/wiki/blob/master/tutorials/%5B%E4%B8%AD%E6%96%87%5D%20Nebulas%20101%20-%2004%20%E6%99%BA%E8%83%BD%E5%90%88%E7%BA%A6%E5%AD%98%E5%82%A8%E5%8C%BA.md#localcontractstorage and deployed the following code:
The contract address is
n1ziQ1AnhMjm5qXxXVM7gRujW8qGRAf9PbE
. And I have callset("ddd", "eee")
in transaction 7d2637a48672227ab7c48d73705110aeb72f52f5f6186ba15e03f6e9d4154a48. However, when I callget
, no results are returned.