Struct ethers::solc::remappings::Remapping [−][src]
Expand description
The solidity compiler can only reference files that exist locally on your computer. So importing directly from GitHub (as an example) is not possible.
Let’s imagine you want to use OpenZeppelin’s amazing library of smart contracts, @openzeppelin/contracts-ethereum-package:
pragma solidity 0.5.11;
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
contract MyContract {
using SafeMath for uint256;
...
}
When using solc, you have to specify the following:
“prefix” = the path that’s used in your smart contract, i.e. “@openzeppelin/contracts-ethereum-package” “target” = the absolute path of OpenZeppelin’s contracts downloaded on your computer
The format looks like this:
solc prefix=target ./MyContract.sol
solc –bin @openzeppelin/contracts-ethereum-package=/Your/Absolute/Path/To/@openzeppelin/ contracts-ethereum-package ./MyContract.sol
Fields
name: String
path: String
Implementations
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<Remapping, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Remapping, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Remapping
impl UnwindSafe for Remapping
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more