You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Erdpy运行Mandos测试报错setState的SC地址正确格式是什么?

你遇到的报错是因为当前版本的Mandos测试框架对地址标识格式有区分要求:普通用户地址使用address:前缀,智能合约(SC)地址必须使用sc:前缀标识,原教程中的旧示例写法不适用于你当前使用的工具版本。

setState中SC地址的正确格式

newAddresses字段下的智能合约地址需要以sc:为前缀,你配置中的对应值应修改为sc:the_crowdfunding_contract,同时需要同步修改测试配置中所有引用该合约地址的位置。

修改后的完整测试配置如下:

{
  "name": "tutorial_crowdfunding",
  "steps": [
    {
      "step": "setState",
      "accounts": {
        "address:my_address": {
          "nonce": "0",
          "balance": "1,000,000"
        }
      },
      "newAddresses": [
        {
          "creatorAddress": "address:my_address",
          "creatorNonce": "0",
          "newAddress": "sc:the_crowdfunding_contract"
        }
      ]
    },
    {
      "step": "scDeploy",
      "tx": {
        "from": "address:my_address",
        "contractCode": "file:../output/tutorial_crowdfunding.wasm",
        "value": "0",
        "gasLimit": "1,000,000",
        "gasPrice": "0"
      },
      "expect": {
        "status": "0",
        "gas": "*",
        "refund": "*"
      }
    },
    {
      "step": "checkState",
      "accounts": {
        "address:my_address": {
          "nonce": "1",
          "balance": "1,000,000"
        },
        "sc:the_crowdfunding_contract": {
          "nonce": "0",
          "balance": "0",
          "storage": {
            "''owner": "address:my_address"
          },
          "code": "file:../output/tutorial_crowdfunding.wasm"
        }
      }
    }
  ]
}

修改完成后重新执行erdpy contract test命令即可正常运行测试。

内容的提问来源于stack exchange,提问作者mccuna

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.26 02:15:04