# Can not deploy smartcontract with truffle and KAS endpoint

**URL:** <https://devforum.kaia.io/t/can-not-deploy-smartcontract-with-truffle-and-kas-endpoint/4701>\
**Category:** KAS (Archive)\
**Tags:** caver-js, smart-contract, klaytn\
**Created:** [4월 5, 2022, 2:38오전 UTC](https://devforum.kaia.io/t/can-not-deploy-smartcontract-with-truffle-and-kas-endpoint/4701 "2022-04-05T02:38:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toan\_Nguyen](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/toan_nguyen/32/2264_2.png) [@Toan\_Nguyen](https://devforum.kaia.io/u/Toan_Nguyen)\
**Post date:** [4월 5, 2022, 2:38오전 UTC](https://devforum.kaia.io/t/can-not-deploy-smartcontract-with-truffle-and-kas-endpoint/4701/1 "2022-04-05T02:38:49Z")

</div>

I get errors like this when deploying smartcontract by truffle using KAS endpoint. Is there anyone getting error like this.  
Used truffle network:

```auto
klay_mainnet: {
      provider: () => {
        const option = {
          headers: [
            {
              name: 'Authorization',
              value:
                'Basic ' +
                Buffer.from(accessKeyId + ':' + secretAccessKey).toString('base64'),
            },
            { name: 'x-chain-id', value: '8217' },
          ],
          keepAlive: false,
        }
        return new HDWalletProvider(
          privateKey,
          new Caver.providers.HttpProvider('https://node-api.klaytnapi.com/v1/klaytn', option)
        )
      },
      network_id: 8217, //Klaytn mainnet's network id
      gas: '8000000',
      gasPrice: '750000000000', 
    },

```

Error:

```auto
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Request failed: Forbidden

```

Note:

- accessKeyId/ secretAccessKey: still valid
- caver-js; 1.6.3 (tried to switch caver-js 1.8 and still get errors)
- truffle-hdwallet-provider-klaytn: 1.4.2
- Truffle v5.1.61.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![KlayToTheMoon](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/klaytothemoon/32/824_2.png) [@KlayToTheMoon](https://devforum.kaia.io/u/KlayToTheMoon)\
**Post date:** [4월 21, 2022, 2:23오전 UTC](https://devforum.kaia.io/t/can-not-deploy-smartcontract-with-truffle-and-kas-endpoint/4701/2 "2022-04-21T02:23:57Z")

</div>

Hmm…  
There seems to be no problem in truffle.config-js
