Why am I getting these errors compiling my contracts that all worked in nov or dec? its like everything changed and none of my contracts compile? Can some help w/these errors? It is happening with all my contracts???
Can you share an example contract that is failing to compile?
I assume you have changed the compiler version to an appropriate version for your contract. For OpenZeppelin Contracts 2.5.0 (please note the latest version of 2.x is 2.5.1) uses Solidity 0.5 and not Solidity 0.6.
What is this error? I did a couple of mock ICOs last yr and deployed them on a local network w/ganache… and then on a test network… and now when i try to compile them i get tons of errors… help ?
pragma solidity ^0.5.5;
import "./PetrolCoin.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.1/contracts/crowdsale/Crowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.1/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.1/contracts/crowdsale/validation/CappedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.1/contracts/crowdsale/validation/TimedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.1/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol";
// @TODO: Inherit the crowdsale contracts
contract PetrolCoinSale is Crowdsale, MintedCrowdsale, CappedCrowdsale, TimedCrowdsale, RefundablePostDeliveryCrowdsale{
constructor(
uint rate,
address payable wallet,
PetrolCoin token,
uint goal,
uint openingTime,
uint closingTime
)
TimedCrowdsale(openingTime, closingTime)
RefundableCrowdsale(goal)
CappedCrowdsale(goal)
Crowdsale(rate, wallet, token)
public
{
// constructor can stay empty
}
}
contract PetrolCoinSaleDeployer {
address public petrol_sale_address;
address public token_address;
constructor(
string memory name,
string memory symbol,
address payable wallet, // this address will receive all Ether raised by the sale
uint goal
)
public
{
// @TODO: create the PetrolCoin and keep its address handy
PetrolCoin token = new PetrolCoin(name, symbol, 0);
token_address = address(token);
// @TODO: create the PetrolCoinSale and tell it about the token, set the goal, and set the open and close times to now and now + 24 weeks.
PetrolCoinSale petrol_sale = new PetrolCoinSale(1000000000000000000, wallet, token, goal, now, now + 60 minutes);
petrol_sale_address = address(petrol_sale);
// make the PetrolCoinSale contract a minter, then have the PetrolCoinSaleDeployer renounce its minter role
token.addMinter(petrol_sale_address);
token.renounceMinter();
}
}
This worked fine before… and now i get errors in the imports… I did one that was exactly the same and the errors i get are different and i cant understand how that is possible when the code is exactly the same… did the imports for these change to??
invalid input source specified?
This is the error i get for one of the contracts… and for the other one which is virtually identical i get 19 errors in the imports… i dont know how that is possible…
Thats what it was orignially and it errors 19 errors in the imports. i changed it to 2.5.1 when you recommended the change in erc20 versions earlier to 2.5.1… so i thought maybe it was supposed to change in these imports to… lol… here is the error message w/2.5.0… this contract used to work fine… i did numerous mock ico’s with it in a local network, test networks and it was all fine… now its giving mass errors…
I was having some issues with Remix if I had contracts open using other versions of Solidity. I closed other contracts and was getting close to compiling (I didn’t have PetrolCoin).
It didn’t compile for me the first time, giving me an error.
I changed to the Release Candidate (I changed the GitHub import) and checked the Solidity compiler version and was able to compile.
That new one worked! thanks. I think sometimes I was not waiting long enough.. the little green area over the compile button was not finished loading the new version, for some reason its taking a really long time for it to change.. there is that slight green thinking thing over the button and then it goes away.... it takes a long time to reset.. thx!
It didn’t compile for me the first time, giving me an error.
I changed to the Release Candidate (I changed the GitHub import) and checked the Solidity compiler version and was able to compile.