2020-05-02 12:21:03 +00:00
# DSA Connectors
2020-05-01 16:01:43 +00:00
2020-05-03 09:35:32 +00:00
Connectors are standard modules that let DeFi Smart Account interact with various smart contracts, and make the important actions accessible like cross protocol interoperability.
2020-05-02 12:07:39 +00:00
## Add Custom Connectors
1. Fork and clone it
2. Create a feature branch: `git checkout -b new-connector`
2020-05-03 00:13:56 +00:00
3. Add the connector solidity file to `contracts/connectors`
4. Commit changes: `git commit -am 'Added a connector'`
5. Push to the remote branch: `git push origin new-connector`
6. Create a new Pull Request.
2020-05-02 12:07:39 +00:00
2020-05-01 16:57:32 +00:00
## Requirements
2020-05-04 05:45:08 +00:00
Be sure to comply with the requirements while building connectors for better compatibility.
2020-05-03 07:06:28 +00:00
- Import common files from `contracts/common` directory.
2020-05-02 09:40:50 +00:00
- The contracts should not have `selfdestruct()` .
- The contracts should not have `delegatecall()` .
2020-05-02 12:18:39 +00:00
- Use `uint(-1)` for maximum amount everywhere.
2020-05-03 07:06:28 +00:00
- Use `getEthAddr()` to denote Ethereum (non-ERC20).
2020-05-03 00:10:50 +00:00
- Use `address(this)` instead of `msg.sender` for fetching balance on-chain, etc.
2020-05-04 05:45:08 +00:00
- Only `approve()` limited amount While giving ERC20 allowance, which strictly needs to be 0 by the end of the spell.
<!-- - If required, Add two additional parameter, `getId` & `setId` in external public functions.
2020-05-02 12:18:39 +00:00
- Use `getUint()` or `setUint()` functions to fetch or store values.
2020-05-04 05:45:08 +00:00
- Call `emitEvent()` after every external public functions. -->
2020-05-01 16:01:43 +00:00
2020-05-03 07:06:28 +00:00
Be sure to check [this mock file ](https://github.com/InstaDApp/dsa-connectors/blob/master/contracts/connectors/mock.sol ) for reference.
2020-05-02 12:28:26 +00:00
2020-05-02 12:07:39 +00:00
## Support
2020-05-01 16:01:43 +00:00
2020-05-02 12:07:39 +00:00
If you can't find something you're looking for or have any questions, ask them at our developers community on [Telegram ](https://t.me/instadevelopers ), [Discord ](https://discord.gg/83vvrnY ) or simply send an [Email ](mailto:info@instadapp.io ).