contract().new

Deploy a smart contract.

Usage

visionWeb.contract().new(options)

Parameters

ParameterDescriptionTypeDefault
optionsDescriptions are below.object-

options parameters

ParameterDescriptionTypeDefault
feeLimitThe maximum VS burns for resource consumption.number20000000
callValueThe VS transfer to the contract for each call.number0
tokenIdThe id of vrc10 token transfer to the contract (Optional).string""
tokenValueThe amount of vrc10 token transfer to the contract for each call (Optional).number0
userFeePercentageConsume user's resource percentage. It should be an integer between [0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up.number100
originEntropyLimitThe maximum resource consumption of the creator in one execution or creation.number10000000
abiAbi.object | array-
bytecodeBytecode.string""
parametersThe list of the parameters of the constructor, It should be converted hexString after encoded according to ABI encoder. If constructor has no parameter, this can be optional.array[]
nameContract name string.string""
permissionIdOptional, for multi-signature use.number0

Returns

Object.

Example

visionWeb.contract().new({
  abi: "contract abi",
  bytecode: "contract bytecode",
  feeLimit: 1000000000,
  callValue: 0,
  userFeePercentage: 100,
  originEntropyLimit: 1,
}).then(instance => {console.log(instance.address)});
> 46f151d2b560d0f0a983cdbfc85fff392bb8874258