ContractAddress 设置

This commit is contained in:
xxq250 2024-06-21 10:35:50 +08:00
parent 15cd3ee52b
commit b094d39b94
2 changed files with 8 additions and 8 deletions

View File

@ -8,5 +8,6 @@ var (
RepoCurBalanceDownOverFlow int64 = -1005 // 当前项目总 Token 数低于0
UserBblanceNotEnough int64 = -1006 // 用户余额不足
ContractAddress string = "0x73dF07368308784063e88F2E150F932782147194"
// go run contract/deploy_call/deploy/deploy.go
ContractAddress string = "0x1396432782239df711013f00260f726375666CDe"
)

View File

@ -77,6 +77,8 @@ func Create(ctx *macaron.Context, opt api.CreateRepoOption, logger *log.Logger)
ctx.JSON(http.StatusOK, api.UnknownErr(err))
return
}
logger.Printf("receipt =================: %v\n", receipt)
//logger.Printf("receipt.Output[2:] =================: %v\n", receipt.Output[2:])
logger.Printf("tx sent: %s\n", tx.Hash().Hex())
// insertedLines, err := strconv.Atoi(receipt.Output[2:])
code, err := parseOutput(opensource.OpenSourceABI, "createRepo", receipt)
@ -156,13 +158,10 @@ func parseOutput(abiStr, name string, receipt *types.Receipt) (*big.Int, error)
fmt.Printf("parse ABI failed, err: %v", err)
}
var ret *big.Int
b, err := hex.DecodeString(receipt.Output[10:])
b1, err := hex.DecodeString(receipt.Output[2:])
log.Printf("hex.DecodeString receipt.Output[2:] =================: %v\n", b1)
log.Printf("hex.DecodeString receipt.len[2:] =================: %v\n", len(b1))
log.Printf("hex.DecodeString receipt.Output[10:] =================: %v\n", b)
log.Printf("hex.DecodeString receipt.len[10:] =================: %v\n", len(b))
log.Printf("hex.DecodeString receipt.Output[4:] =================: %v\n", len(b)%32)
b, err := hex.DecodeString(receipt.Output[2:])
log.Printf("hex.DecodeString receipt.Output[2:] =================: %v\n", b)
log.Printf("hex.DecodeString receipt.len[2:] =================: %v\n", len(b))
log.Printf("hex.DecodeString receipt.Output[2:] =================: %v\n", len(b)%32)
if err != nil {
return nil, fmt.Errorf("decode receipt.Output[2:] failed, err: %v", err)
}