Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions contracts/AddressResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ contract AddressResolver is OwnableTwoStep, IAddressResolver, Initializable {
address[] internal _promises;

uint256 public asyncPromiseCounter;
uint64 public version;

// contracts to gateway map
mapping(address => address) public override contractsToGateways;
Expand All @@ -48,7 +49,8 @@ contract AddressResolver is OwnableTwoStep, IAddressResolver, Initializable {

/// @notice Initializer to replace constructor for upgradeable contracts
/// @param owner_ The address of the contract owner
function initialize(address owner_) public reinitializer(1) {
function initialize(address owner_, uint64 version_) public reinitializer(version_) {
version = version_;
_claimOwner(owner_);

forwarderImplementation = address(new Forwarder());
Expand Down Expand Up @@ -98,7 +100,8 @@ contract AddressResolver is OwnableTwoStep, IAddressResolver, Initializable {
Forwarder.initialize.selector,
chainSlug_,
chainContractAddress_,
address(this)
address(this),
version
);
salt = keccak256(constructorArgs);
}
Expand All @@ -111,7 +114,8 @@ contract AddressResolver is OwnableTwoStep, IAddressResolver, Initializable {
AsyncPromise.initialize.selector,
invoker_,
msg.sender,
address(this)
address(this),
version
);

salt = keccak256(abi.encodePacked(constructorArgs, asyncPromiseCounter));
Expand Down
2 changes: 1 addition & 1 deletion contracts/AsyncPromise.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract AsyncPromise is IPromise, Initializable, AddressResolverUtil {
address invoker_,
address forwarder_,
address addressResolver_
) public reinitializer(1) {
) public initializer {
_setAddressResolver(addressResolver_);
localInvoker = invoker_;
forwarder = forwarder_;
Expand Down
3 changes: 2 additions & 1 deletion contracts/Forwarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contract Forwarder is IForwarder, Initializable {

/// @notice caches the latest async promise address for the last call
address public latestAsyncPromise;
uint64 public version;

constructor() {
_disableInitializers(); // disable for implementation
Expand All @@ -36,7 +37,7 @@ contract Forwarder is IForwarder, Initializable {
uint32 chainSlug_,
address onChainAddress_,
address addressResolver_
) public reinitializer(1) {
) public initializer {
chainSlug = chainSlug_;
onChainAddress = onChainAddress_;
addressResolver = addressResolver_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contract AuctionManager is AddressResolverUtil, OwnableTwoStep, IAuctionManager,
mapping(bytes32 => bool) public override auctionStarted;

uint256 public auctionEndDelaySeconds;
uint64 public version;

/// @notice Error thrown when trying to start or bid a closed auction
error AuctionClosed();
Expand All @@ -46,10 +47,12 @@ contract AuctionManager is AddressResolverUtil, OwnableTwoStep, IAuctionManager,
uint256 auctionEndDelaySeconds_,
address addressResolver_,
SignatureVerifier signatureVerifier_,
address owner_
) public reinitializer(1) {
address owner_,
uint64 version_
) public reinitializer(version_) {
_setAddressResolver(addressResolver_);
_claimOwner(owner_);
version = version_;
vmChainSlug = vmChainSlug_;
signatureVerifier = signatureVerifier_;
auctionEndDelaySeconds = auctionEndDelaySeconds_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "solady/utils/Initializable.sol";

contract DeliveryHelper is BatchAsync, OwnableTwoStep, Initializable {
event CallBackReverted(bytes32 asyncId_, bytes32 payloadId_);
uint64 public version;

constructor() {
_disableInitializers(); // disable for implementation
Expand All @@ -24,9 +25,11 @@ contract DeliveryHelper is BatchAsync, OwnableTwoStep, Initializable {
address addressResolver_,
address feesManager_,
address owner_,
uint256 bidTimeout_
) public reinitializer(1) {
uint256 bidTimeout_,
uint64 version_
) public reinitializer(version_) {
_setAddressResolver(addressResolver_);
version = version_;
feesManager = feesManager_;
bidTimeout = bidTimeout_;
_claimOwner(owner_);
Expand Down
8 changes: 7 additions & 1 deletion contracts/apps/payload-delivery/app-gateway/FeesManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "solady/utils/Initializable.sol";
contract FeesManager is IFeesManager, AddressResolverUtil, OwnableTwoStep, Initializable {
uint256 public feesCounter;
mapping(uint32 => uint256) public feeCollectionGasLimit;
uint64 public version;

/// @notice Struct containing fee amounts and status
struct TokenBalance {
Expand Down Expand Up @@ -99,7 +100,12 @@ contract FeesManager is IFeesManager, AddressResolverUtil, OwnableTwoStep, Initi
/// @notice Initializer function to replace constructor
/// @param addressResolver_ The address of the address resolver
/// @param owner_ The address of the owner
function initialize(address addressResolver_, address owner_) public reinitializer(1) {
function initialize(
address addressResolver_,
address owner_,
uint64 version_
) public reinitializer(version_) {
version = version_;
_setAddressResolver(addressResolver_);
_claimOwner(owner_);
}
Expand Down
5 changes: 4 additions & 1 deletion contracts/socket/utils/SignatureVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import "solady/utils/Initializable.sol";
* @dev This contract is modular component in socket to support different signing algorithms.
*/
contract SignatureVerifier is ISignatureVerifier, AccessControl, Initializable {
uint64 public version;

/*
* @dev Error thrown when signature length is invalid
*/
Expand All @@ -23,7 +25,8 @@ contract SignatureVerifier is ISignatureVerifier, AccessControl, Initializable {
* @notice initializes and grants RESCUE_ROLE to owner.
* @param owner_ The address of the owner of the contract.
*/
function initialize(address owner_) public reinitializer(1) {
function initialize(address owner_, uint64 version_) public reinitializer(version_) {
version = version_;
_claimOwner(owner_);
_grantRole(RESCUE_ROLE, owner_);
}
Expand Down
8 changes: 6 additions & 2 deletions contracts/watcherPrecompile/WatcherPrecompile.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable {
/// @dev callId => bool
mapping(bytes32 => bool) public appGatewayCalled;

uint64 public version;

/// @notice Error thrown when an invalid chain slug is provided
error InvalidChainSlug();
/// @notice Error thrown when an invalid app gateway reaches a plug
Expand Down Expand Up @@ -97,10 +99,12 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable {
function initialize(
address owner_,
address addressResolver_,
uint256 maxLimit_
) public reinitializer(1) {
uint256 maxLimit_,
uint64 version_
) public reinitializer(version_) {
_setAddressResolver(addressResolver_);
_claimOwner(owner_);
version = version_;
maxTimeoutDelayInSeconds = 24 * 60 * 60; // 24 hours

LIMIT_DECIMALS = 18;
Expand Down
60 changes: 30 additions & 30 deletions deployments/dev_addresses.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
{
"421614": {
"SignatureVerifier": "0x5e5CF700c97BC8B3F6215D98E65f85D4A44d7D06",
"Hasher": "0x6A8e801B3299FeB96D0607A01a62Db8A9239Bdc0",
"Socket": "0xa09217Cfc47F399C382E982778f6128685e13aD4",
"SocketBatcher": "0x80568677f2B092bd974657FE47Fc8531bfE5DBDC",
"FastSwitchboard": "0x5aA84ffE5eCCB5263d1AE6aEd5682EAb39Bc7036",
"FeesPlug": "0x63d3F60Db6a7Eb2fa730F850dA247C73aD162656",
"ContractFactoryPlug": "0x87cC19AedD434ebD3B74FfdC073CAeC7dC1E92EA",
"startBlock": 123791225
"ContractFactoryPlug": "0xE86EdC6457Bf25434b6D23AdbE2F8D3D975e67FC",
"FastSwitchboard": "0xFF0A8a7BBB3a1C7Fb64318B1f3Cff50c52530370",
"FeesPlug": "0x78aE0a397Bb16d08956F040f97182fdcC19200DD",
"Hasher": "0x491B2365BB79520F0f4884e6e022287683671245",
"SignatureVerifier": "0x99DC5Cb4DadbDF09cc46E7F6e0B514094e928f9a",
"Socket": "0x82dC1E9882CDCB071B1940503585E9E6be527511",
"SocketBatcher": "0x75111143CbfdE7F8C5e558ad78AB4141ED3DbE6b",
"startBlock": 124608724
},
"7625382": {
"SignatureVerifierImpl": "0xCd44A8068117d888fb44Eb4fDe49bc9B7085189E",
"AddressResolverImpl": "0xBCF275473fdECEf5AFe22D1c771Cb79317be58dB",
"ERC1967Factory": "0xaAF245274e877795B01671602a753AafAc459297",
"SignatureVerifier": "0x2eF8A7768c42342927B9e41E468CC2984835DC58",
"AddressResolver": "0xF2bb0cA7Eab6a2c4ed64793959Ac4401159D5D13",
"WatcherPrecompileImpl": "0x345c85aCc495E6FeDCf52987BDc0636A12F8AEd7",
"WatcherPrecompile": "0x376AdA81749a64e9C2439025f475D1a7E004fcC1",
"FeesManagerImpl": "0x3Ee25f844976888B29A921443b34374d9eCC466d",
"FeesManager": "0x4D29076a0590909F3Bda7f85466cd8Ee291A1247",
"DeliveryHelperImpl": "0xAEE7D460fD1d8c4be069443a65187BC50A0BA89A",
"DeliveryHelper": "0xc0560207cBDBc5301E8343C51f8A7da339596969",
"AuctionManagerImpl": "0x6B94BfF71631f21166946e80967774F3f45e9A0b",
"AuctionManager": "0xE5A00A99C5C8E40d1C6Ec817bc808d71b1d4369b",
"startBlock": 5424
"AddressResolver": "0x83b9f8829870989c233eD457FEBf5E2852F6f7e6",
"AddressResolverImpl": "0xE6C9cf66F57f6aF78585235E36E94007020e3746",
"AuctionManager": "0xE285dA5E0Af241148196045a8D0c554e9dCfdc5B",
"AuctionManagerImpl": "0xb888e3a8F9cC8F0281796958B01862427417b0Ea",
"DeliveryHelper": "0x96DD7A17d8BB599365d437ab0F34d7505187F9E8",
"DeliveryHelperImpl": "0x5bA4C527883F7D9e12d71Da5Cd170f26eCF2F901",
"ERC1967Factory": "0x494660a4bDcafC43a5522B98117D678654c6D3d5",
"FeesManager": "0x1B0d860ffC6D42Bc0Bd6C4b5bCe39F6694392AF5",
"FeesManagerImpl": "0x731f609cae8C9B6862B4c1D43dE29d4759f878F8",
"SignatureVerifier": "0x050433b2288F24FE6d87D3081343038D3BfBe39E",
"SignatureVerifierImpl": "0x70BA68CbDFc530E1AD62d9aFAf43a40B87D0730b",
"startBlock": 5488,
"WatcherPrecompile": "0xB588980Af36d5b718eBd4FCe3170Ee5Dd04A57D8",
"WatcherPrecompileImpl": "0x32D3c608405b9b037A574550a40477F8Ea1f8B5B"
},
"11155420": {
"SignatureVerifier": "0x36AC527afA283c95EA7dD11c8E93225d9F139028",
"Hasher": "0xd36C1Dcb65CB09b7fCFABf153D7cdd42312C782E",
"Socket": "0xB0e1D8536ed769860f344Cf795f2B4fAaa41F0C8",
"SocketBatcher": "0x5fef21aD7Dc13CB1b7Cb9EAD404e3EA38d153348",
"FastSwitchboard": "0x688cf2744cd66F00E34f8BbAd15C8fb2438D62be",
"FeesPlug": "0xc13eb89675c12efF5faf5bE9B4773F9ed9192107",
"ContractFactoryPlug": "0x0E0F673C9b34d08b99407F1947A10Fe73aa17928",
"startBlock": 23870487
"ContractFactoryPlug": "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9",
"FastSwitchboard": "0x1E407363aec8952bff0ff35A596997d11b32f9c4",
"FeesPlug": "0x70B9067056b533A4e780C5E64228C60defFbC558",
"Hasher": "0xb34DB19C7FAeECf14B3D0336C6E34f7dc1336968",
"SignatureVerifier": "0xF86B89B5c689c170BfD2734254228D6d2db5a672",
"Socket": "0xfBa932AaE9Ae2777aEC77832FC0C2D9059C8E905",
"SocketBatcher": "0xdd7b56968a3505D1A10181F2880cAA65a89E4750",
"startBlock": 23996336
}
}
38 changes: 38 additions & 0 deletions deployments/dev_addresses_geth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"421614": {
"ContractFactoryPlug": "0x1dc20d27F06876cA74ee4e2E9a4724f06a4a5E54",
"FastSwitchboard": "0xaFFfaD81e6DDE509Bd83Ab2024225b2FF537BeA7",
"FeesPlug": "0xb2B779ab8FC851bCE986d25B2824933B0Cd101d9",
"Hasher": "0x49f24A72e738Fe86263Aa26696370972e049498B",
"SignatureVerifier": "0xb6d39d1dB2cB14043182a008EfFC079A9C578208",
"Socket": "0x9B06e2Dae351ed8B1112C036e5c306E8fBe4C9c5",
"SocketBatcher": "0xd627BFe7d2fCAC1147c996a6F2CAaB2E1e1bD344",
"startBlock": 124035386
},
"7625382": {
"AddressResolver": "0x1287D33646d763Ff8237Aa7BE7d92Fc918c66589",
"AddressResolverImpl": "0x8662FC08dEC7c61Dd3432fAF45a5bC024BB60B00",
"AuctionManager": "0xE3806Bc41FEAFCAA2480E702fF02dA14F767bF0F",
"AuctionManagerImpl": "0x4C68058509d754Cc0dE474eBC20aE94e4787E704",
"DeliveryHelper": "0x4D8Fb6e8a5294ed0644f462b5723ee228ecf9958",
"DeliveryHelperImpl": "0x3c9f5172feb0dDfC06176cE67B566EFbb01CCe98",
"ERC1967Factory": "0xbBfb525ADc6eC38Ef0D4b807d327c2Dd1C286de1",
"FeesManager": "0x886682a69D6c0240EB850cc2e42c5B4B74449e82",
"FeesManagerImpl": "0xF4D3BDe438416938217d4624c82AEbEb46CeD371",
"SignatureVerifier": "0x366Dea9AC69fb9D45b6756587D2fE9B4c14197F6",
"SignatureVerifierImpl": "0x3cf47Ad0F040dFF1208E649C8f8e23e6B5A08916",
"startBlock": 18,
"WatcherPrecompile": "0xaCf94Cd4A7e70304F5CA6294CDAe3CBe78Ea6A86",
"WatcherPrecompileImpl": "0x8F18fC10a8b40b548C6F04Fb252481c783A9ace0"
},
"11155420": {
"ContractFactoryPlug": "0x0EE19F0D0e34Cdd2eb4F61E24DC837b0b7c34e69",
"FastSwitchboard": "0x70bfB36F8b8de7763F1D52d954225ae88F6Ed595",
"FeesPlug": "0x7F5D263572469Fdf1875Cd858D557B45e9FC7f23",
"Hasher": "0xe37D675646A6FEEC3E41A0FF9535E0E716f5cD89",
"SignatureVerifier": "0x0452225B52Ef6134499232CbBEDF05fD8cc38530",
"Socket": "0x0BAAD473580c9F7Ca8b2758759aF3ce5E3154bC6",
"SocketBatcher": "0xCf731f35EFd775F692fe24e650e75Fd64bBaD810",
"startBlock": 23911773
}
}
Loading