near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
108 stars 76 forks source link

Need assistance with deployment of a Sputnik-like DAO #140

Closed siddharthborderwala closed 2 years ago

siddharthborderwala commented 2 years ago

Hello, I am Siddharth, a full stack web3 developer from Crypto Capable, India. I am trying to deploy the smart contract for a DAO, having a subset of the features of sputnik. I am facing a problem during the Instantiation of the contract. The build scripts and the cargo.toml config are the exact same as sputnik.

I am passing this data to create a DAO but it is not working - image Link to the above transaction - https://explorer.testnet.near.org/transactions/8z1utD7PnhD7y1PN9uuTD4Lf3rbooQ5kvsh92U1TaYvF

This is what the error message looks like: Failure:

{
  "ActionError": {
    "index": 3,
    "kind": {
      "FunctionCallError": {
        "CompilationError": {
          "PrepareError": "Instantiate"
        }
      }
    }
  }
}

This is the function signature to instantiate the new DAO: image

It would be great if someone from the sputnik team can help me out. Even a pointer to the solution would be highly appreciated!

Sincerely Siddharth Borderwala Crypto Capable India

TrevorJTClarke commented 2 years ago

Hi @siddharthborderwala - interesting problem. I suggest trying to use the official code for now (here is testnet deployed: https://testnet-v2.sputnik.fund/#/) While we dont have customer service support for sputnik, I encourage you to checkout Astro

siddharthborderwala commented 2 years ago

Hello @TrevorJTClarke thanks a lot for the idea and your time. I kept digging at this problem and found out that using the rand crate was causing this issue.

So, rand depends on getrandom which does not support wasm-unknown-unknown in the near protocol EVMs. Hence, the compiled WASM Code was not able to Instantiate the Contract.

Now, I am instead using a custom secure random number generator and the contract instantiates without errors.