github.com/smartcontractkit/chainlink-testing-framework/libs@v0.0.0-20240227141906-ec710b4eb1a3/docs/contracts/index.md (about) 1 --- 2 layout: default 3 title: Contracts 4 nav_order: 6 5 has_children: false 6 --- 7 8 # Smart Contracts 9 10 Tests require deploying at least a few contracts to whatever chain you're running on. You can find the code used to deploy and interact with these contracts in the [contracts](https://github.com/smartcontractkit/integrations-framework/tree/main/contracts) package. Most of these are self-explanatory, but Keeper and OCR can be a bit more complicated. 11 12 ## Contract Deployer 13 14 Each network has a contract deployer 15 16 ```go 17 // See the previous setup code on how to get your default network 18 // The contract deployer will use the first private key listed to deploy contracts from 19 contractDeployer, err := contracts.NewContractDeployer(defaultNetwork) 20 ``` 21 22 From here, you can use the `contractDeployer` on its own, as defined [here](https://pkg.go.dev/github.com/smartcontractkit/integrations-framework/contracts#ContractDeployer). For a lot of one off contracts, like the Link Token contract, that's all you need. 23 24 ```go 25 contractDeployer.DeployLinkTokenContract() 26 ``` 27 28 From there, contract interactions are defined in the [contracts package](https://pkg.go.dev/github.com/smartcontractkit/integrations-framework/contracts#pkg-overview). 29 30 ## Adding New Contracts 31 32 <div class="note note-purple"> 33 Currently it's a bit of a laborious process to add a new contract that isn't already defined. We're planning on improving this in the future. If you have ideas to make things easier, feel free to make a PR! 34 </div> 35