I have two simple contracts, a base one (BaseClass.sol):

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;

abstract contract BaseContract {
    address private immutable wallet;
    constructor(address _wallet) {

        require(_wallet != address(0), "address not set");

        wallet = _wallet;

And a contract that derives from the base one by passing the wallet address on the constructor (DerivedClass.sol):

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;

import "./BaseClass.sol";

contract DerivedContract
    is BaseContract(0x0000000000000000000000000000000000000000) {
    constructor() {}

Everything works but on remix the default selected contract is always BaseContract, not DerivedContract.

enter image description here

This is cumbersome because I need to keep needing to switch back to DerivedContract when deploying.

Any way to have DerivedContract set as the default contract when compiling it?


  • It appears they are sorted by alphabetical order. – Ismael Mar 21 at 18:17
  • @Ismael doesn't seem so, I renamed DerivedContract to ADerivedContract and the order remained the same. – smartins Mar 21 at 19:00
  • 1
    It seems to be sorted by the file's name and within the same file contract by name. – Ismael Mar 21 at 19:33
  • 1
    @Ismael right on, it's file name + contract name. Thanks! Feel free to submit it as an answer so that I mark as accepted answer. – smartins Mar 21 at 19:40

It appears the current version sort contracts by the file's name and within the same file contracts are sorted by name.

- Welcome to Remix 0.10.10 -

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.