Comments (3)
TRON does not support creating contracts in contracts.
A new contract address will be generated with an empty code.
from tronweb.
@GalymzhanAbdimanap Could you please show your code?
from tronweb.
@summertanh
pragma experimental ABIEncoderV2;
//import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol";
import "safeMath.sol";
import "Token-contract.sol";
contract AuctionBox{
//Auction[] public auctions;
using SafeMath for uint256;
//Auction a;
TRC20 trc20;
.........
function createAuction (
string memory _title,
uint _startPrice,
string memory _description,
uint _count,
uint _commission
)payable public{
Auction newAuction = new Auction(msg.sender, address(this), _title, _startPrice, _description, _count, _commission);
// push the auction address to auctions array
auctions.push(newAuction);
}
}
contract Auction {
TRC20 trc20;
AuctionBox ab;
using SafeMath for uint256;
address payable public owner;
string title;
uint startPrice;
.........
constructor(
address payable _owner,
address _addressBox,
string memory _title,
uint _startPrice,
string memory _description,
uint _count,
uint _commission
) public {
// initialize auction
owner = _owner;
title = _title;
startPrice = _startPrice;
description = _description;
count = _count;
commission = _commission;
auctionState = State.Running;
constPrice = startPrice;
commisionConst = commission;
trc20 = TRC20(address(0x235F857D7947b9bC5Dc73f489B70Ef870e6263ed));
ab = AuctionBox(_addressBox);
}
...........
}
if you want look at all code:
from tronweb.
Related Issues (20)
- multiSign for Contracts return invalid transaction
- multiSign for Contracts return invalid transaction HOT 3
- Invalid address in TRC20 Token HOT 10
- Error messages determination and handling HOT 3
- I am getting OUT OF ENERGY Error HOT 1
- How to actually calculate the amount of resources for a transaction? HOT 6
- An error occurred while running in nodejs HOT 1
- How to proper decode a smart contract input data? HOT 3
- Tronscan
- Why types are not exported?! HOT 4
- Allow raw axios headers HOT 2
- Invalid type for block.transactions HOT 2
- Error [ERR_REQUIRE_ESM]: require() of ES Module
- TypeError: TronWeb is not a constructor HOT 1
- tronweb has no permission to sign error when sign transaction with multisig HOT 2
- Module "crypto" has been externalized for browser compatibility: Vite + React HOT 7
- How to get contract address via address?
- Error "Cannot find module '@noble/secp256k1'" keeps appearing HOT 1
- Non-base58 character when i try signing a transaction HOT 1
- Decode Message in CONTRACT_VALIDATE_ERROR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tronweb.