Loading...
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
npm install -g tronbox
tronbox unbox metacoin
Smart contract will be in the folder -> contracts, migrations files are in the migrations folder. and main file is tronbox.js where you can configure for networks.
replace contracts with your smart contracts and also in migrations change the corresponding contract filename and variable names
module.exports = {
networks: {
development: {
// For trontools/quickstart docker image
privateKey:
"",
userFeePercentage: 30,
feeLimit: 100000000,
fullHost: "http://127.0.0.1:9090",
network_id: "*"
},
mainnet: {
// Don't put your private key here, pass it using an env variable, like:
// PK=private_key tronbox migrate --network mainnet
privateKey: process.env.PK,
userFeePercentage: 30,
feeLimit: 100000000,
fullHost: "https://api.trongrid.io",
network_id: "*"
},
shasta: {
privateKey:
"private_key",
userFeePercentage: 50,
feeLimit: 1e8,
fullHost: "https://api.shasta.trongrid.io",
network_id: "*"
}
}
};
tronbox compile --compile-all
tronbox migrate -- network shasta