Giter Site home page Giter Site logo

Comments (3)

andelf avatar andelf commented on July 24, 2024

TRON does not support creating contracts in contracts.
A new contract address will be generated with an empty code.

from tronweb.

unicornonea avatar unicornonea commented on July 24, 2024

@GalymzhanAbdimanap Could you please show your code?

from tronweb.

GalymzhanAbdimanap avatar GalymzhanAbdimanap commented on July 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.