-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from zkemail/feat/oauth-mvp
Feat/oauth mvp
- Loading branch information
Showing
55 changed files
with
12,137 additions
and
1,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,7 @@ book | |
|
||
# Vs code settings | ||
.vscode | ||
|
||
# Oauth-sdk | ||
packages/oauth-sdk/.env | ||
packages/oauth-sdk/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import "forge-std/Script.sol"; | ||
import "forge-std/console.sol"; | ||
import "../src/utils/OauthCore.sol"; | ||
|
||
contract Deploy is Script { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
if (deployerPrivateKey == 0) { | ||
console.log("PRIVATE_KEY env var not set"); | ||
return; | ||
} | ||
|
||
address oauthCore = vm.envAddress("OAUTH_CORE"); | ||
if (oauthCore == address(0)) { | ||
console.log("OAUTH_CORE env var not set. Deploy OAUTH_CORE and set env var"); | ||
return; | ||
} | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
OauthCore oauthCoreImpl = new OauthCore(); | ||
|
||
OauthCore oauthCoreProxy = OauthCore(payable(address(oauthCore))); | ||
oauthCoreProxy.upgradeTo(address(oauthCoreImpl)); | ||
|
||
// If you want to call some v2 function, refer to the following steps | ||
// | ||
// TokenRegistryV2 tokenRegistryV2 = TokenRegistryV2(address(tokenRegistry)); | ||
// address usdc = tokenRegistry.getTokenAddress(0, "USDC"); | ||
|
||
vm.stopBroadcast(); | ||
|
||
console.log("OauthCore implementation deployed at: %s", address(oauthCoreImpl)); | ||
console.log("---- DONE ----"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.