Proxy Smart Contracts
We use smart contracts as a bridge between our cold storage system and these on-chain Ethereum contracts.
When we choose to integrate with a new network, like Maker Governance, we start by writing a customized smart contract that wraps around their smart contracts’ APIs like a glove. These ‘proxy’ smart contracts all come out slightly different, since they wrap different functionality, but share a few core similarities.
First, they are exceedingly simple. All storage variables are set when the contract is deployed, and never change. No branching logic is implemented in these contracts as well. Regardless of their simplicity, a 3rd party security audit is performed to ensure the safety and security of these contracts..
For instance, the proxy contract we used to allow our customers to participate in the Edgeware lockdrop was less than 30 lines of code with only one externally callable method:
Small and to the point
contract EdgewareSignalProxy {
address payable public fundDst;
address public fundSrc;
address public admin;
bytes public edgewareAddr;
Lockdrop public lockdrop;
constructor(
Lockdrop _lockdrop,
address _fundSrc,
address payable _fundDst,
address _admin,
bytes memory _edgewareAddr
) public {
lockdrop = _lockdrop;
fundSrc = _fundSrc;
fundDst = _fundDst;
admin = _admin;
edgewareAddr = _edgewareAddr;
}
modifier auth() {
require(msg.sender == admin || msg.sender == fundDst, "Sender must be the fund destination or admin address");
_;
}
function () external payable {
require(msg.sender == fundSrc, "Sender must be the fund source address");
signal();
}
function signal() internal {
lockdrop.signal(address(this), 0, edgewareAddr);
}
function release() external auth {
address(fundDst).transfer(address(this).balance);
}
}
Second, they are designed to interface with only a single cold address. This keeps all client funds segregated and maintains the security and auditability of all actions taken by this contract.
Third, and most importantly, these contracts are all configured to return funds to, and only to, a pre-set cold storage address. Securing this out-channel gives confidence that once we move funds into these contracts, their only possible destination is a Coinbase Custody Cold storage address.