I updated the code to use Yul, which brought costs down a bit.
Yul source:
object "Proxy" {
// deployment code
code {
let size := datasize("runtime")
datacopy(0, dataoffset("runtime"), size)
return(0, size)
}
object "runtime" {
// deployed code
code {
calldatacopy(0, 0, calldatasize())
mstore(0, create2(callvalue(), 0, calldatasize(), 0))
return(12, 20)
}
}
}
The signed deterministic deployment transaction is now:
f8748085174876e800830186a08080a3601580600e600039806000f350fe366000600037600036600034f56000526014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222
The init code for the proxy contract is now:
601580600e600039806000f350fe366000600037600036600034f56000526014600cf3
The deployed proxyâs code is now:
366000600037600036600034f56000526014600cf3
For fun, I was able to gas golf the deployment code to:
6f3d36363d3d373d34f53d526014600cf33d5260106010f3
and the proxy code to:
3d36363d3d373d34f53d526014600cf3
However, I decided there was value in having Yul source code available for the deployed contract rather than just raw bytecode, so I decided to eat the extra size and costs (they are marginal).