I am trying to compile the MetaCoin contract (part of the Truffle Init Webpack). I need to get the byte code as hex numbers so that I can use it with Nethereum. The MetaCoin contains an import to ConvertLib.sol:
pragma solidity ^0.4.4;
import "./ConvertLib.sol";
contract MetaCoin {
...
When I compile it (using either Truffle from the command line or the Solidity extension for VS Code), the byte code I get is:
0x6060 ... 0073__ConvertLib____________________________6396 ... 0029
This is obviously a reference the ConvertLib library. When I use Nethereum to try and deploy the contract:
...
var ByteCode =
"0x6060 ... 0073__ConvertLib____________________________6396 ... 0029";
var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(
Abi, ByteCode, Address, Gas, GasPrice);
I get the error message:
System.InvalidOperationException: Character '_' at index '604' is not valid alphanumeric character.
Clearly, it does not like the "ConvertLib" reference in the middle of the byte code. I could just include the library code in the MetaCoin contract and remove the import, but I would like to sort this problem out properly.
How can I compile the MetaCoin contract so that it includes the ConvertLib library in the byte code?