Deploy a smart contract.
Usage
visionWeb.contract().new(options)
Parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
| options | Descriptions are below. | object | - |
options parameters
| Parameter | Description | Type | Default |
|---|---|---|---|
| feeLimit | The maximum VS burns for resource consumption. | number | 20000000 |
| callValue | The VS transfer to the contract for each call. | number | 0 |
| tokenId | The id of vrc10 token transfer to the contract (Optional). | string | "" |
| tokenValue | The amount of vrc10 token transfer to the contract for each call (Optional). | number | 0 |
| userFeePercentage | Consume 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. | number | 100 |
| originEntropyLimit | The maximum resource consumption of the creator in one execution or creation. | number | 10000000 |
| abi | Abi. | object | array | - |
| bytecode | Bytecode. | string | "" |
| parameters | The 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 | [] |
| name | Contract name string. | string | "" |
| permissionId | Optional, for multi-signature use. | number | 0 |
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
