Hi I am trying to figure out what is the right way to migrate the contract by using new() method of the contract. The following does not work, the contract does not seam to be migrated (though it is deployed). What am I missing here?

var UidProvider = artifacts.require("./UidProvider.sol");

module.exports = async function(deployer) {

  await deployer.then(async function() {
   return UidProvider.new();


  • Copy the default migration file and change in it the name of the contract from Migration to UidProvider :/ – Majd TL Aug 30 '20 at 13:10
  • Why do you want to use new? – Majd TL Aug 30 '20 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.