# (솔리디티)함수를 실행하여 컨트랙트에 돈을 송금하고 싶습니다

**URL:** <https://devforum.kaia.io/t/topic/2518>\
**Category:** Kaia\
**Created:** [11월 23, 2021, 3:21오후 UTC](https://devforum.kaia.io/t/topic/2518 "2021-11-23T15:21:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuriae](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/wuriae/32/974_2.png) [@wuriae](https://devforum.kaia.io/u/wuriae)\
**Post date:** [11월 23, 2021, 3:21오후 UTC](https://devforum.kaia.io/t/topic/2518/1 "2021-11-23T15:21:18Z")

</div>

컨트랙트에 있는 NFT를 구입하는 함수를 구현하려 합니다.

```auto
function buyNFT(uint256 tokenId, address NFTaddress) public payable returns (bool) {
        // 0.01klay
        if (NFTaddress == address(this)) // 만일 NFT의 주인이 컨트랙트라면
        {
            address payable receiver = address(this); // ㅡㅡㅡㅡErrorㅡㅡㅡㅡ
            receiver.transfer(10**16); // 0.01KLAY
            nft_kms(NFTaddress).safeTransferFrom(address(this), msg.sender, tokenId, '0x00'); // send NFT
            return true;
        }
        // ...
}

```

하지만 표시한 줄에서 오류가 뜨네요, 어떤문제가 있을까요?  
에러메세지: Type address is not implicitly convertible to expected type address payable.

---

<div class="post-metadata">

**Author:** ![jeongkyun.oh88](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/jeongkyun.oh88/32/1482_2.png) [@jeongkyun.oh88](https://devforum.kaia.io/u/jeongkyun.oh88)\
**Post date:** [12월 8, 2021, 3:58오전 UTC](https://devforum.kaia.io/t/topic/2518/2 "2021-12-08T03:58:31Z")

</div>

@wuriae 안녕하세요,

Solidity documentation를 참조부탁드립니다.  
`address` 타입에서 `address payable` 타입으로 casting은 불가합니다.

감사합니다.

> The address type comes in two flavours, which are largely identical:
> 
> address: Holds a 20 byte value (size of an Ethereum address).
> 
> address payable: Same as address, but with the additional members transfer and send.
> 
> The idea behind this distinction is that address payable is an address you can send Ether to, while a plain address cannot be sent Ether.
