web3
web3 copied to clipboard
add http support for imports #233
adds support of the following imports
pragma solidity ^0.8.10;
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/tokens/nf-token-metadata.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/tokens/nf-token.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/tokens/erc721-metadata.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/ownership/ownable.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/tokens/erc721.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/tokens/erc721-token-receiver.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/utils/erc165.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/utils/supports-interface.sol";
import "https://raw.githubusercontent.com/nibbstack/erc721/master/src/contracts/utils/address-utils.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);
}
}
@treeder wdyt? The downside is that it requires you to build a list of dependencies and explicitly mention all of them in the header (in theory we could scan every file for imports and try to resolve them)
Why can't we just let solc handle it?
@treeder because solc doesn't support that (only remix - they recommend using it) check this thread - https://github.com/gochain/web3/issues/233#issuecomment-1002952217