Links

caver.contract

caver.contract 객체는 Klaytn 블록체인과 스마트 컨트랙트 간의 상호작용을 쉽게 만들어 줍니다. 새 컨트랙트 객체를 생성할 때 해당 스마트 컨트랙트를 위해 JSON 인터페이스를 제공해야 하는데, 이때 caver-js가 자바스크립트로 작성된 컨트랙트 객체와의 모든 호출을 RPC를 통해 하위 수준의 ABI 호출로 자동 변환시켜줍니다.
이를 통해 스마트 컨트랙트가 마치 자바스크립트 객체인 것처럼 스마트 컨트랙트와 상호작용할 수 있습니다.

caver.contract.create

caver.contract.create(jsonInterface [, address] [, options])
JSON 인터페이스 오브젝트에 정의된 모든 메소드 및 이벤트로 새 컨트랙트 인스턴스를 생성합니다. This function works the same as new caver.contract.
참고 caver.contract.create는 caver-js v1.6.1부터 지원됩니다.
파라미터
리턴값
예시
const contract = caver.contract.create([
{
constant: true,
inputs: [{ name: 'interfaceId', type: 'bytes4' }],
name: 'supportsInterface',
outputs: [{ name: '', type: 'bool' }],
payable: false,
stateMutability: 'view',
type: 'function',
},
...
], '0x{address in hex}')

caver.contract

new caver.contract(jsonInterface [, address] [, options])
JSON 인터페이스 오브젝트에 정의된 모든 메소드 및 이벤트로 새 컨트랙트 인스턴스를 생성합니다.
파라미터
이름
타입
설명
jsonInterface
객체
컨트랙트를 인스턴스화하기 위한 JSON 인터페이스
address
string
(선택 사항) 호출할 스마트 컨트랙트의 주소. myContract.options.address = '0x1234..'를 사용하여 나중에 추가할 수 있습니다.
options
객체
(선택 사항) 컨트랙트 옵션. 자세한 내용은 아래 표를 참조하세요.
옵션 개체에는 다음이 포함됩니다:
이름
타입
설명
from
string
(선택 사항) 트랜잭션이 만들어진 송신자 주소.
가스 가격
string
(선택 사항) 트랜잭션에 사용할 peb 단위의 가스 가격.
gas
number
(선택 사항) 트랜잭션에 규정된 최대 가스 (가스 제한).
데이터
string
(선택 사항) 컨트랙트의 바이트 코드. 컨트랙트가 배포될 때 사용됩니다.
feeDelegation
boolean
(선택 사항) 수수료 위임 트랜잭션 사용 여부를 나타냅니다.
feePayer
string
(선택 사항) 트랜잭션 수수료를 부담하는 수수료 납부자의 주소입니다. feeDelegationtrue일 때, 값은 트랜잭션의 feePayer 필드에 설정됩니다.
feeRatio
string
(optional) Fee payer가 부담하게될 트랜잭션 수수료의 비율입니다. feeDelegationtrue이며, feeRatio가 유효한 값으로 설정되었을 경우, 부분 수수료 위임 트랜잭션이 사용됩니다. 유효한 범위는 1에서 99 사이입니다. 0이나 100 이상의 값은 허용되지 않습니다.
리턴값
타입
설명
객체
모든 메소드와 이벤트가 있는 컨트랙트 인스턴스.
예시
const myContract = new caver.contract([...], '0x{address in hex}', { gasPrice: '25000000000' })

myContract.options

myContract.options
컨트랙트 인스턴스에 대한 options 객체. from, gas, gasPrice, feePayer 그리고 feeRatio는 트랜잭션 전송시 대체값으로 사용됩니다.
속성
이름
타입
설명
address
string
컨트랙트가 배포된 주소.
jsonInterface
Array
컨트랙트의 JSON 인터페이스.
from
string
컨트랙트 배포/실행 트랜잭션을 전송하는 기본 주소입니다. 트랜잭션 생성시 from 주소가 정의되어 있지 않다면, 트랜잭션 생성시 항상 myContract.options.from가 사용됩니다.
가스 가격
string
트랜잭션에 사용할 peb 단위의 가스 가격.
gas
number
트랜잭션에 제공된 최대 가스 (가스 제한).
데이터
string
컨트랙트의 바이트 코드. 컨트랙트가 배포될 때 사용됩니다.
feeDelegation
boolean
(선택 사항) 수수료 위임 트랜잭션 사용 여부를 나타냅니다.
feePayer
string
(선택 사항) 트랜잭션 수수료를 부담하는 수수료 납부자의 주소입니다. feeDelegationtrue일 때, 값은 트랜잭션의 feePayer 필드에 설정됩니다.
feeRatio
string
(optional) Fee payer가 부담하게될 트랜잭션 수수료의 비율입니다. feeDelegationtrue이며, feeRatio가 유효한 값으로 설정되었을 경우, 부분 수수료 위임 트랜잭션이 사용됩니다. 유효한 범위는 1에서 99 사이입니다. 0이나 100 이상의 값은 허용되지 않습니다.
참고 feeDelegation, feePayer, 그리고 feeRatio는 caver-js v1.6.1 이후부터 지원됩니다.
예시
> myContract.options
{
address: [Getter/Setter],
jsonInterface: [Getter/Setter],
from: [Getter/Setter],
feePayer: [Getter/Setter],
feeDelegation: [Getter/Setter],
feeRatio: [Getter/Setter],
gasPrice: [Getter/Setter],
gas: [Getter/Setter],
data: [Getter/Setter]
}
> myContract.options.from = '0x1234567890123456789012345678901234567891' // default from address
> myContract.options.gasPrice = '25000000000000' // default gas price in peb
> myContract.options.gas = 5000000 // provide as fallback always 5M gas
> myContract.options.feeDelegation = true // use fee delegation transaction
> myContract.options.feePayer = '0x1234567890123456789012345678901234567891' // default fee payer address
> myContract.options.feeRatio = 20 // default fee ratio when send partial fee delegation transaction

myContract.options.address

myContract.options.address
이 컨트랙트 인스턴스 myContract에 사용된 주소. 해당 컨트랙트에서 caver-js에 의해 생성된 모든 트랜잭션에 이 주소가 to로서 포함될 것입니다.
속성
이름
타입
설명
address
string \
null
예시
> myContract.options.address
'0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae'
// 컨트랙트 주소 설정
> myContract.options.address = '0x1234FFDD...'

myContract.options.jsonInterface

myContract.options.jsonInterface
이 컨트랙트 myContract의 ABI에서 파생된 JSON 인터페이스 객체.
속성
이름
타입
설명
jsonInterface
Array
이 컨트랙트의 JSON 인터페이스. 이를 재설정하면 컨트랙트 인스턴스의 메소드 및 이벤트가 재생성됩니다.
예시
> myContract.options.jsonInterface
[
{
constant: true,
inputs: [ { name: 'interfaceId', type: 'bytes4' } ],
name: 'supportsInterface',
outputs: [ { name: '', type: 'bool' } ],
payable: false,
stateMutability: 'view',
type: 'function',
signature: '0x01ffc9a7',
},
...
{
anonymous: false,
inputs: [
{ indexed: true, name: 'owner', type: 'address' },
{ indexed: true, name: 'spender', type: 'address' },
{ indexed: false, name: 'value', type: 'uint256' }
],
name: 'Approval',
type: 'event',
signature: '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925',
},
]
// 새 jsonInterface 설정
> myContract.options.jsonInterface = [...]

myContract.clone

myContract.clone([contractAddress])
현재 컨트랙트 인스턴스를 복제합니다.
파라미터
이름
타입
설명
contractAddress
String
(선택 사항) 새 컨트랙트의 주소입니다. 미입력시 오리지널 인스턴스(예: myContract.options.address)의 주소로 설정됩니다.
리턴값
타입
설명
객체
새로 복제된 컨트랙트 인스턴스.
예시
> myContract.clone()
Contract {
currentProvider: [Getter/Setter],
...
_keyrings: KeyringContainer { ... }
}

myContract.deploy

myContract.deploy(options, byteCode [, param1 [, param2 [, ...]]])
컨트랙트를 Klaytn 네트워크에 배포합니다. 성공적으로 배포된 후, Promise는 새로운 컨트랙트 인스턴스와 함께 해결(resolved)될 것입니다. Unlike the usability of the existing myContract.deploy function, this function sends a transaction directly to the Klaytn network. 반환된 객체와 함께 send()를 호출할 필요가 없습니다.
NOTE 서명을 하기 위해서는 caver.walletoptionsmyContract.optionsfromfeePayer에 해당하는 키링 인스턴스를 포함해야 합니다.
참고 myContract.deploy는 caver-js v1.6.1부터 지원됩니다.
파라미터
이름
타입
설명
options
객체
전송에 사용되는 옵션. See the table in methods.methodName.send for the details.
byteCode
string
컨트랙트의 바이트 코드.
parameters
복합
(선택 사항) 배포시 생성자에게 전달되는 파라미터입니다.
리턴값
PromisePromiEvent를 반환: Promise가 새로운 컨트랙트 인스턴스와 함께 해결(resolved)됩니다.
타입
설명
PromiEvent
프로미스(promise)가 조합된 이벤트 이미터(event emitter). 트랜잭션 영수증이 준비되면 해결(resolve)됩니다. myContract.deploy()에서 send()가 호출될 경우, Promise는 새로운 컨트랙트 인스턴스와 함께 해결(resolved)됩니다.
PromiEvent에서는 다음 이벤트가 발생할 수 있습니다.
  • "transactionHash": 트랜잭션이 전송되고 트랜잭션 해시가 준비된 직후에 발생합니다. 타입은 string입니다.
  • receipt: 트랜잭션 영수중이 준비되면 발생합니다. See caver.rpc.klay.getTransactionReceipt for more details. 타입은 object입니다.
  • error: 전송 중 에러가 발생하면 발생합니다. 가스 부족 에러(out-of-gas)가 발생한 경우 두 번째 인자는 트랜잭션 영수증입니다. 타입은 error입니다.
예시
// Deploy a smart contract without constructor arguments
> myContract.deploy({
from: '0x{address in hex}',
gas: 1500000,
}, '0x{byte code}')
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
console.log(receipt.contractAddress) // contains the new contract address
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address) // instance with the new contract address
})
// Deploy a smart contract with constructor arguments
> myContract.deploy({
from: '0x{address in hex}',
gas: 1500000,
}, '0x{byte code}', 'keyString', ...)
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
console.log(receipt.contractAddress)
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address)
})
// Deploy a smart contract with fee delegation transaction (TxTypeFeeDelegatedSmartContractDeploy)
> myContract.deploy({
from: '0x{address in hex}',
feeDelegation: true,
feePayer: '0x{address in hex}',
gas: 1500000,
}, '0x{byte code}')
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
console.log(receipt.contractAddress)
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address)
})
// Deploy a smart contract with partial fee delegation transaction (TxTypeFeeDelegatedSmartContractDeployWithRatio)
> myContract.deploy({
from: '0x{address in hex}',
feeDelegation: true,
feePayer: '0x{address in hex}',
feeRatio: 30,
gas: 1500000,
}, '0x{byte code}')
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
console.log(receipt.contractAddress)
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address)
})

myContract.deploy

myContract.deploy(options)
Klaytn에 스마트 컨트랙트를 배포할 때 사용되는 객체를 반환합니다. myContract.deploy({ data, arguments }).send(options)를 호출함으로써 스마트 컨트랙트 배포 트랜잭션을 전송할 수 있습니다. 성공적으로 배포된 후, Promise는 새로운 컨트랙트 인스턴스와 함께 해결(resolved)될 것입니다.
파라미터
이름
타입
설명
options
객체
배포에 사용되는 옵션 객체입니다. 자세한 내용은 아래 표를 참조하세요.
옵션 개체에는 다음이 포함됩니다:
이름
타입
설명
데이터
string
컨트랙트의 바이트 코드.
arguments
Array
(선택 사항) 배포시 생성자에게 전달되는 인자입니다.
리턴값
타입
설명
객체
An object in which arguments and functions for contract distribution are defined. 자세한 내용은 아래 표를 참조하세요.
The object contains the following:
이름
타입
설명
arguments
Array
The arguments passed in options.arguments.
send
function
The function that will deploy the contract to the Klaytn. The promise as the result of this function will be resolved with the new contract instance.
서명
function
The function that will sign a smart contract deploy transaction as a sender. The sign function will return signed transaction.
function
The function that will sign a smart contract deploy transaction as a fee payer. The signAsFeePayer function will return signed transaction.
function
The function that will estimate the gas used for the deployment. The execution of this function does not deploy the contract.
encodeABI
function
The function that encodes the ABI of the deployment, which is contract data + constructor parameters. The execution of this function does not deploy the contract.
참고 myContract.deploy({ data, arguments }).sign(options) and myContract.deploy({ data, arguments }).signAsFeePayer(options)는 caver-js v1.6.1부터 지원됩니다.
예시
> myContract.deploy({
data: '0x12345...',
arguments: [123, 'My string']
})
.send({
from: '0x1234567890123456789012345678901234567891',
gas: 1500000,
value: 0,
}, function(error, transactionHash) { ... })
.on('error', function(error) { ... })
.on('transactionHash', function(transactionHash) { ... })
.on('receipt', function(receipt) {
console.log(receipt.contractAddress) // contains the new contract address
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address) // instance with the new contract address
})
// When the data is already set as an option to the contract itself
> myContract.options.data = '0x12345...'
> myContract.deploy({
arguments: [123, 'My string']
})
.send({
from: '0x1234567890123456789012345678901234567891',
gas: 1500000,
value: 0,
})
.then(function(newContractInstance) {
console.log(newContractInstance.options.address) // instance with the new contract address
})
// Simply encoding
> myContract.deploy({
data: '0x12345...',
arguments: [123, 'My string']
})
.encodeABI()
'0x12345...0000012345678765432'
// Gas estimation
> myContract.deploy({
data: '0x12345...',
arguments: [123, 'My string']
})
.estimateGas(function(err, gas) {
console.log(gas)
})

myContract.send

myContract.send(options, methodName [, param1 [, param2 [, ...]]])
스마트 컨트랙트 함수를 실행하기 위한 트랜잭션을 보냅니다. 이러한 호출은 스마트 컨트랙트의 상태를 변경할 수 있습니다.
이 함수에 사용되는 트랜잭션 타입은 optionsmyContract.options에 정의된 값에 따라 결정됩니다. myContract.send를 통해 수수료 위임 트랜잭션을 사용하고 싶다면, feeDelegationfeePayer를 올바르게 설정해야 합니다.
NOTE 서명을 하기 위해서는 caver.walletoptionsmyContract.optionsfromfeePayer에 해당하는 키링 인스턴스를 포함해야 합니다.
참고 myContract.send는 caver-js v1.6.1부터 지원됩니다.
파라미터
이름
타입
설명
options
객체
전송에 사용되는 옵션. See the table in methods.methodName.send for the details.
methodName
string
실행할 컨트랙트 함수의 메서드 이름입니다.
parameters
복합
(선택 사항) 스마트 컨트랙트 함수에 전달되는 파라미터입니다.
리턴값
Promise returns PromiEvent
타입
설명
PromiEvent
프로미스(promise)가 조합된 이벤트 이미터(event emitter). 트랜잭션 영수증이 준비되면 해결(resolve)됩니다. The promise will be resolved with the new contract instance.
PromiEvent에서는 다음 이벤트가 발생할 수 있습니다.
  • "transactionHash": 트랜잭션이 전송되고 트랜잭션 해시가 준비된 직후에 발생합니다. 타입은 string입니다.
  • receipt: 트랜잭션 영수중이 준비되면 발생합니다. See caver.rpc.klay.getTransactionReceipt for more details. 타입은 object입니다.
  • error: 전송 중 에러가 발생하면 발생합니다. 가스 부족 에러(out-of-gas)가 발생한 경우 두 번째 인자는 트랜잭션 영수증입니다. 타입은 error입니다.
예시
// Send a SmartContractExecution and use the promise
> myContract.send({ from: '0x{address in hex}', gas: 1000000 }, 'methodName', 123).then(console.log)
{
blockHash: '0x294202dcd1d3c422880e2a209b9cd70ce7036300536c78ab74130c5717cb90da',
blockNumber: 16342,
contractAddress: null,
from: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
gas: '0xf4240',
gasPrice: '0x5d21dba00',
gasUsed: 47411,
input: '0x983b2...',
logsBloom: '0x00800...',
nonce: '0x1cd',
senderTxHash: '0xe3f50d2bab2c462ef99379860d2b634d85a0c9fba4e2b189daf1d96bd4bbf8ff',
signatures: [ { V: '0x4e43', R: '0x2ba27...', S: '0x50d37...' } ],
status: true,
to: '0x361870b50834a6afc3358e81a3f7f1b1eb9c7e55',
transactionHash: '0xe3f50d2bab2c462ef99379860d2b634d85a0c9fba4e2b189daf1d96bd4bbf8ff',
transactionIndex: 0,
type: 'TxTypeSmartContractExecution',
typeInt: 48,
value: '0x0',
events: {...}
}
// Send a SmartContractExecution and use the event emitter
> myContract.send({ from: '0x{address in hex}', gas: 1000000 }, 'methodName', 123)
.on('transactionHash', function(hash) {
...
})
.on('receipt', function(receipt) {
console.log(receipt)
})
.on('error', console.error)
// Send a FeeDelegatedSmartContractExecution
> myContract.send({
from: '0x{address in hex}',
gas: 1000000,
feeDelegation: true,
feePayer: '0x{address in hex}',
}, 'methodName', 123).then(console.log)
{
blockHash: '0x149e36f279577c306fccb9779a0274e802501c32f7054c951f592778bd5c168a',
blockNumber: 16458,
contractAddress: null,
feePayer: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
feePayerSignatures: [ { V: '0x4e43', R: '0x48c28...', S: '0x18413...' } ],
from: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
gas: '0xf4240',
gasPrice: '0x5d21dba00',
gasUsed: 57411,
input: '0x983b2d5600000000000000000000000022bb89bd35e7b12bd25bea4165cf0f9330032f8c',
logsBloom: '0x00800...',
nonce: '0x1f5',
senderTxHash: '0x5b06ca5046229e066c11dfc0c74fcbc98509294370981f9b142378a8f2bd5fe8',
signatures: [ { V: '0x4e44', R: '0xfb707...', S: '0x641c6...' } ],
status: true,
to: '0x361870b50834a6afc3358e81a3f7f1b1eb9c7e55',
transactionHash: '0x0e04be479ad06ec87acbf49abd44f16a56390c736f0a7354860ebc7fc0f92e13',
transactionIndex: 1,
type: 'TxTypeFeeDelegatedSmartContractExecution',
typeInt: 49,
value: '0x0',
events: {...}
}
// Send a FeeDelegatedSmartContractExecutionWithRatio
> myContract.send({
from: '0x{address in hex}',
gas: 1000000,
feeDelegation: true,
feePayer: '0x{address in hex}',
feeRatio: 30,
}, 'methodName', 123).then(console.log)
{
blockHash: '0x8f0a0137cf7e0fea503c818910140246437db36121871bc54b2ebc688873b3f3',
blockNumber: 16539,
contractAddress: null,
feePayer: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
feePayerSignatures: [ { V: '0x4e43', R: '0x80db0...', S: '0xf8c7c...' } ],
feeRatio: '0x1e',
from: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
gas: '0xf4240',
gasPrice: '0x5d21dba00',
gasUsed: 62411,
input: '0x983b2d560000000000000000000000007ad1a538041fa3ba1a721f87203cb1a3822b8eaa',
logsBloom: '0x00800...',
nonce: '0x219',
senderTxHash: '0x14c7b674a0e253b31c85c7be8cbfe4bf9d86e66e940fcae34b854e25eab1ce15',
signatures: [ { V: '0x4e43', R: '0xd57ef...', S: '0xe14f3...' } ],
status: true,
to: '0x361870b50834a6afc3358e81a3f7f1b1eb9c7e55',
transactionHash: '0xfbf00ec189aeb0941d554384f1660ffdac7768b3af2bb1526bcb3983215c1183',
transactionIndex: 0,
type: 'TxTypeFeeDelegatedSmartContractExecutionWithRatio',
typeInt: 50,
value: '0x0',
events: {...}
}

myContract.sign

myContract.sign(options, methodName [, param1 [, param2 [, ...]]])
스마트 컨트랙트 배포 또는 스마트 컨트랙트 함수 실행을 위해 발신자로서 스마트 컨트랙트 트랜잭션에 서명합니다.
스마트 컨트랙트가 배포되었다면 myContract.sign({ from, ... }, 'constructor', byteCode, ...)와 같이 'constructor'를 methodName에 입력할 수 있습니다.
이 함수에 사용되는 트랜잭션 타입은 optionsmyContract.options에 정의된 값에 따라 결정됩니다. myContract.sign를 통해 수수료 위임 트랜잭션을 사용하고 싶다면, feeDelegationdl true로 정의되어야 합니다.
NOTE 서명을 하기 위해서는 caver.walletoptionsmyContract.optionsfrom에 해당하는 키링 인스턴스를 포함해야 합니다.
참고 myContract.sign은 caver-js v1.6.1부터 지원됩니다.
파라미터
이름
타입
설명
options
객체
전송에 사용되는 옵션. See the table in methods.methodName.send for the details.
methodName
string
실행할 컨트랙트 함수의 메서드 이름입니다. 스마트 컨트랙트 배포를 위해 트랜잭션에 서명하고 싶다면 메서드 이름 대신 'constructor' 문자열을 사용하세요.
parameters
복합
(선택 사항) 스마트 컨트랙트 함수에 전달되는 파라미터입니다. 스마트 컨트랙트 배포 트랜잭션에 서명하고 싶다면 바이트코드와 생성자 파라미터를 전달하세요.
리턴값
Promise returning Transaction - The signed smart contract transaction.
예시
// Sign a SmartContractDeploy
> myContract.sign({ from: '0x{address in hex}', gas: 1000000 }, 'constructor', byteCode, 123).then(console.log)
SmartContractDeploy {
_type: 'TxTypeSmartContractDeploy',
_from: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
_gas: '0xf4240',
_signatures: [ SignatureData { _v: '0x4e43', _r: '0xeb6b5...', _s: '0x5e4f9...' } ],
_to: '0x',
_value: '0x0',
_input: '0x60806...',
_humanReadable: false,
_codeFormat: '0x0',
_chainId: '0x2710',
_gasPrice: '0x5d21dba00',
_nonce: '0x2a5'
}
// Sign a FeeDelegatedSmartContractDeploy
> myContract.sign({ from: '0x{address in hex}', feeDelegation: true, gas: 1000000 }, 'constructor', byteCode, 123).then(console.log)
FeeDelegatedSmartContractDeploy {
_type: 'TxTypeFeeDelegatedSmartContractDeploy',
_from: '0x69c3a6e3485446118d8081063dcef2e65b69ae91',
_gas: '0xf4240',
_signatures: [ SignatureData { _v: '0x4e43', _r: '0xee0f5...', _s: '0x31cbf...' } ],
_feePayer: '0x0000000000000000000000000000000000000000',
_feePayerSignatures: [ SignatureData { _v: '0x01', _r: '0x', _s: '0x' } ],
_to: '0x',
_value: '0x0',
_input: '0x60806...',
_humanReadable: false,
_codeFormat: '0x0',
_chainId: '0x2710',
_gasPrice: '0x5d21dba00',
_nonce: '0x320'
}
// Sign a FeeDelegatedSmartContractDeployWithRatio
> myContract.sign({ from: keyring.address, feeDelegation: true, feeRatio: 30