How to create new connector for new protocol

Synthetix Staking Connector
Anyone can create new connector for other protocol that we haven’t been integrated. Let’s take the Synthetix Staking Connector as example https://github.com/InstaDApp/dsa-connectors/blob/master/contracts/connectors/synthetix.sol. We have created deposit, withdraw and claimReward three functions.

Testing
Testing is critical for smart contract. But there’s issue with testing DSA account cast delegatecall with mainnet fork that it can’t connect to external contracts. That’s why our tests are using mock contracts https://github.com/gnosis/mock-contract for external protocols. And internal mock contract for passing the mock contract into our connector. You can take MockSyntheti.sol as example. https://github.com/InstaDApp/dsa-connectors/blob/master/contracts/tests/MockSynthetix.sol.

Requirements
Remember to also check requirements

Conclusion
Anyone is welcome to create a PR to have the smart contract with test coverage for other protocol so that we can review and merge for more spells

1 Like

hey guys, this link is broken

Here’s another simple example:

With test here:

1 Like