I'm trying to create a copy of an contract existent contract using web3.js 1.0. I'm trying to use the functions clone and deploy but without success.
contract2 = contract1.clone();
contract2.deploy().send({from : web3.eth.defaultAccount})
.on('error', function(error){
alert(error);
})
.then(function(result){
alert(result);
}
);