Hice mi biblioteca personalizada y trato de usarla en mi propio proyecto.
A continuación se muestra el 2_deploy_contracts.js
module.exports = async(deployer, netowrk) => {
await deployer.deploy(OptionStorage, ownerAddress);
await deployer.deploy(LDerivativeFactory);
await deployer.link(LDerivativeFactory, DerivativeFactory);
await deployer.deploy(DerivativeFactory, OptionStorage.address, XToken);
};
y en casos de prueba, estoy tratando de usarlo como
beforeEach(async () => {
optionStorage = await OptionStorage.new(owner);
//library = await Library.new();
//DerivativeFactory.link('LDerivativeFactory',library.address);
derivativeFactory = await DerivativeFactory.new(optionStorage.address, quoteToken.address, { from : owner, gas : 50000 });
});
pero al ejecutar los casos de prueba me encuentro con el error
Error: DerivativeFactory contiene bibliotecas sin resolver. Debe implementar y vincular las siguientes bibliotecas antes de poder implementar una nueva versión de DerivativeFactory: LDerivativeFactory
¿Como resolverlo? También trato de vincular en los casos de prueba, luego terminé con un error diferente
Error: Error: la tarifa base supera el límite de gasolina
Cualquier ayuda es admirable
Debe usar la solución recomendada en el problema n. ° 501 , el problema que causa es que los artefactos de la trufa no se actualizan en el orden correcto.
async function doDeploy(deployer, network) {
await deployer.deploy(OptionStorage, ownerAddress);
await deployer.deploy(LDerivativeFactory);
await deployer.link(LDerivativeFactory, DerivativeFactory);
await deployer.deploy(DerivativeFactory, OptionStorage.address, XToken);
}
module.exports = (deployer, network) => {
deployer.then(async () => {
await doDeploy(deployer, network);
});
};
Jitendra Kumar. Balla
ismael
Satyam Agrawal
Error: VM Exception while processing transaction: revert
Satyam Agrawal