Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

tron - How to send callValue or msg.value from migrations.js

I am learning solidity smart contract. I am using tronbox as my development framework. While deploying contract, I need to send some trx to contract address. So that It will be available in msg.value. For example this is my constructor function,

constructor() public payable {
    require(msg.value == 2 trx, "2 trx initial funding required");
}

How to send this 2 trx, while deploying contract in migration file. For example this is my migration file,

var SimpleBank = artifacts.require("./Simple.sol");
var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Simple);
  deployer.deploy(Migrations);
};
question from:https://stackoverflow.com/questions/65641917/how-to-send-callvalue-or-msg-value-from-migrations-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...