Build proxy contracts that can evolve and be upgraded over time
TAC provides TacProxyV1Upgradeable for contracts that need to be upgraded after deployment. Use this base contract when you need upgrade functionality.
contract MyUpgradeableProxy is Initializable, // Must be first OwnableUpgradeable, // Access control UUPSUpgradeable, // Upgrade mechanism TacProxyV1Upgradeable // TAC functionality (last)
The inheritance order is critical and must follow OpenZeppelin’s recommended pattern.
// ❌ DON'T use constructor for setupconstructor(address crossChainLayer) { // This won't work properly with upgradeable contracts!}// ✅ DO use initializer functionfunction initialize(address owner, address crossChainLayer) public initializer{ __UUPSUpgradeable_init(); __Ownable_init(owner); __TacProxyV1Upgradeable_init(crossChainLayer);}