Browse Source

devnet: Fix WETH token address

Kevin Peters 3 years ago
parent
commit
83499fcda0
1 changed files with 10 additions and 4 deletions
  1. 10 4
      ethereum/scripts/deploy_test_token.js

+ 10 - 4
ethereum/scripts/deploy_test_token.js

@@ -61,10 +61,6 @@ module.exports = async function (callback) {
       from: accounts[0],
       gas: 1000000,
     });
-    await token.methods.mint(accounts[2], "1000000000000000000000").send({
-      from: accounts[0],
-      gas: 1000000,
-    });
 
     const nftAddress = (
       await ERC721.new(
@@ -93,6 +89,16 @@ module.exports = async function (callback) {
 
     console.log("WETH token deployed at: " + wethAddress);
 
+    await token.methods.mint(accounts[2], "1000000000000000000000").send({
+      from: accounts[0],
+      gas: 1000000,
+    });
+
+    // devnet WETH token address should be deterministic
+    if (wethAddress !== "0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E") {
+      throw new Error("unexpected WETH token address")
+    }
+
     callback();
   } catch (e) {
     callback(e);