Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build. #233

Open
bitcoinmeetups opened this issue Oct 28, 2021 · 12 comments
Open

Cannot build. #233

bitcoinmeetups opened this issue Oct 28, 2021 · 12 comments
Assignees

Comments

@bitcoinmeetups
Copy link

Hello,

I'm MB. A very nice and polite guy.

This is my contract:

// SPDX-License-Identifier: MIT pragma solidity 0.8.0;

import
"https://github.com/0xcert/ethereum-erc721/src
/contracts/tokens/nf-token-metadata.sol";
import
"https://github.com/0xcert/ethereum-erc721/src
/contracts/ownership/ownable.sol";

contract newNFT is NFTokenMetadata, Ownable {

constructor() {
nftName = "Synth NFT";
nftSymbol = "SYN";
}

function mint(address _to, uint256 _tokenId,
string calldata _uri) external onlyOwner {
super._mint(_to, _tokenId);
super._setTokenUri(_tokenId, _uri);
}

}

When I try to build using this command:

web3 contract build nft.sol

I get this error message:

ERROR: Cannot generate flattened file: read ./.: is a directory

@bitcoinmeetups
Copy link
Author

No matter what I type, I don't get a bin file.

@treeder
Copy link
Contributor

treeder commented Oct 28, 2021

What OS are you using?

@r-gochain
Copy link
Contributor

@bitcoinmeetups github imports are not supported in web3, please download it locally (clone) and import as local files

@treeder
Copy link
Contributor

treeder commented Dec 28, 2021

He's talking about these imports: import
"https://github.com/0xcert/ethereum-erc721/src
/contracts/tokens/nf-token-metadata.sol";

@r-gochain why wouldn't it support that if it's part of solidity now?

https://docs.soliditylang.org/en/v0.8.10/path-resolution.html

@treeder treeder reopened this Dec 28, 2021
@r-gochain
Copy link
Contributor

@treeder sure, let me check if we can support that in web3 (improve flattening algorithm or maybe just pass to solidity compiler as is)

@r-gochain r-gochain self-assigned this Dec 29, 2021
@treeder
Copy link
Contributor

treeder commented Dec 29, 2021

Or maybe we don't flatten and just let solc do it's thing? I know it's nice to see the flattened file for verification and things, but if solc handles it, why not just use it?

@r-gochain
Copy link
Contributor

Yes, I'm going to check whichever is easier

@r-gochain
Copy link
Contributor

hmmm, so solc doesn't support these type of imports (latest version)

image

@r-gochain
Copy link
Contributor

@r-gochain
Copy link
Contributor

solcjs doesn't work either, seems like there are only 2 options

@treeder
Copy link
Contributor

treeder commented Jan 4, 2022

Ahh, I see, didn't realize that was remix only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants