# Baobab에서는 동작, cypress에서는 안동작

**URL:** <https://devforum.kaia.io/t/baobab-cypress/4395>\
**Category:** Kaia\
**Tags:** smart-contract, klaytn\
**Created:** [3월 16, 2022, 8:18오전 UTC](https://devforum.kaia.io/t/baobab-cypress/4395 "2022-03-16T08:18:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyunwoo0](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/gyunwoo0/32/2129_2.png) [@gyunwoo0](https://devforum.kaia.io/u/gyunwoo0)\
**Post date:** [3월 16, 2022, 8:18오전 UTC](https://devforum.kaia.io/t/baobab-cypress/4395/1 "2022-03-16T08:18:50Z")

</div>

안녕하세요.  
다름이 아니라 개발 중인 코드 중 일부가 baobab에서는 동작하고, cypress에서는 동작하지 않아서 질문 드립니다.

코드와 에러 첨부드립니다.

+@ gasPrice에 변경관련 메일을 받은게 기억나서 750ston을 명시하면, Error: Returned error: invalid unit price 라는 에러가 나고요.

```nohighlight
const callobj = this.contract.methods.safeTransfer(to, value)
        const gas = await callobj.estimateGas({from: this.sender.address}); // gas 조회
        console.log('[*] estimated gas:', gas)

        const result = await callobj.send({
            from: this.sender.address,
            gas
        }); // tx send

```

에러는 아래와 같습니다.

```auto
     Error: out of gas
 {
  "blockHash": "0x2532a2522ccce61d138c8fea0da36c5620fccd3a6d3f652f70d97d261cb01ad5",
  "blockNumber": 85542849,
  "contractAddress": null,
  "from": "0xdf977ea48ac6afe2fd7caab6b47a717cf398d822",
  "gas": "0x92ac",
  "gasPrice": "0x5d21dba00",
  "gasUsed": 37548,
  "input": "0x423f6cef000000000000000000000000b83f74246fc4d535ceb9c45a6a8dd79705b0895a000000000000000000000000000000000000000000000000000000000000000a",
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "nonce": "0x55",
  "senderTxHash": "0xae2ad9d649c1c839b3f2944d4b1f367b6263f0b3638246f1799aa676bff31191",
  "signatures": [
    {
      "V": "0x4056",
      "R": "0x20824357d9d99a3f3f3b60758f3eb08f79e28d2078d2f03e1f45bf0efa81196a",
      "S": "0x6632b22133906a9a3629e08c1ec23da2b9b160832eb775b4cf4c8e1b2ce981ab"
    }
  ],
  "status": false,
  "to": "0x99d7f56cf9c75d998ea78f03b6783b1f7d4e2d75",
  "transactionHash": "0xae2ad9d649c1c839b3f2944d4b1f367b6263f0b3638246f1799aa676bff31191",
  "transactionIndex": 1,
  "txError": "0x7",
  "type": "TxTypeSmartContractExecution",
  "typeInt": 48,
  "value": "0x0",
  "events": {}
}

```

---

<div class="post-metadata">

**Author:** ![gyunwoo0](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/gyunwoo0/32/2129_2.png) [@gyunwoo0](https://devforum.kaia.io/u/gyunwoo0)\
**Post date:** [3월 16, 2022, 8:48오전 UTC](https://devforum.kaia.io/t/baobab-cypress/4395/3 "2022-03-16T08:48:10Z")

</div>

아 호출방법을 바꾸니까 cypress에서도 되네요

baobab에서는 되던게 cypress에선 안되서 혼란스러웠습니다.

```nohighlight
        const callobj = this.contract.methods.safeTransfer(to, value)
        const gas = await callobj.estimateGas({from: this.sender.address}); // gas 조회
        console.log('[*] estimated gas:', gas)

        // const result = await callobj.send({
        // from: this.sender.address,
        // gas
        // }); // tx send

        const result = await this.caver.klay.sendTransaction({
            from: this.sender.address,
            to:this.tokenAddr,
            data: callobj.encodeABI(),
            gas,
        })

```

---

<div class="post-metadata">

**Author:** ![Sung-Yeoul\_Park](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/sung-yeoul_park/32/1691_2.png) [@Sung-Yeoul\_Park](https://devforum.kaia.io/u/Sung-Yeoul_Park)\
**Post date:** [3월 19, 2022, 3:13오후 UTC](https://devforum.kaia.io/t/baobab-cypress/4395/4 "2022-03-19T15:13:59Z")

</div>

안녕하세요?  
혹시 어떻게 성공하셨는지 자세히 좀 알 수 있을까요?  
caver.klay.sendTransaction 이 함수를 사용하면  
지원하지 않는 메소드라고 뜨는데…  
클레이튼 cypress에서 어떤 식으로 트랜잭션을 발생하는지 그러니까,  
유저가 사이트에서 민팅 버튼을 누르면  
결제창이 열려서 결제를 하고  
NFT가 발송되는지를 모르겠습니다.

밤 늦게라도 좋으니 부디 연락주시길 부탁드립니다.  
감사합니다.
