# 솔리디티 파일에 만든 함수에 데이터 넣는법

**URL:** <https://devforum.kaia.io/t/topic/4222>\
**Category:** Kaia\
**Tags:** caver-js, smart-contract, klaytn\
**Created:** [3월 5, 2022, 11:20오전 UTC](https://devforum.kaia.io/t/topic/4222 "2022-03-05T11:20:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kk.h](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kk.h](https://devforum.kaia.io/u/kk.h)\
**Post date:** [3월 5, 2022, 11:20오전 UTC](https://devforum.kaia.io/t/topic/4222/1 "2022-03-05T11:20:18Z")

</div>

안녕하세요 NFT에 관심이 많아서 공부를 하던 도중에 잘 안되는 부분이 있어서 질문 드립니다.

실타래 컨트랙트를 가져와서 KIP17 쪽 솔리디티 파일을 보던중 궁금한게 생겼어요 .

function setupSale(uint256 newAntibotInterval,  
address newMetakongzContract,  
uint256 newMintLimitPerBlock,  
uint256 newMintLimitPerSale,  
string calldata newTokenBaseURI,  
uint256 newMintStartBlockNumber,  
uint256 newMaxSaleAmount,  
uint256 newMintPrice) external onlyMinter{  
\_antibotInterval = newAntibotInterval;  
\_metakongzContract = newMetakongzContract;  
\_mintLimitPerBlock = newMintLimitPerBlock;  
\_mintLimitPerSale = newMintLimitPerSale;  
\_tokenBaseURI = newTokenBaseURI;  
\_mintStartBlockNumber = newMintStartBlockNumber;  
\_maxSaleAmount = newMaxSaleAmount;  
\_mintPrice = newMintPrice;  
}

이런 값들에 대한 셋업 하는 함수가 있는데 해당 함수는 어떻게 값을 집어넣는지 알 수 있을까요?

스크립트 단에서 단순히 setupSale(a,b,c,d,e,f,g,h)로 넣으면 들어가는걸까요?

코딩공부를 한지 얼마 안되서 잘 모르겠습니다. 도와주시면 감사합니다.

---

<div class="post-metadata">

**Author:** ![lorance.call](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/lorance.call/32/1653_2.png) [@lorance.call](https://devforum.kaia.io/u/lorance.call)\
**Post date:** [3월 6, 2022, 4:09오전 UTC](https://devforum.kaia.io/t/topic/4222/2 "2022-03-06T04:09:19Z")

</div>

어떤 환경에서 코딩하시느냐에 따라 다릅니다.

다른 솔리디티 파일에서 실행하시려면 선행조건이, 해당 컨트랙트에 minter role 을 설정하셔야하고 (onlyMinter modifier 때문), 상기 함수 인터페이스 코드 만드셔서 컨트랙트 인스턴스 호출후 각 input 값 데이터타입만.맞추셔서 입력해주시면 됩니다.

만약 node.js 등에서 caver-js를 이용해 수행하시는경우 ABI 및 주소를 이용해 컨트랙트 인스턴스 생성하신후

const receipt = await myContract.methods.myMethod(a,b,c,…,d).send({from: 서명할지갑주소, gas: 가스비})

형태로 send 해서 트랜잭션을 발생시키시면됩니다.
