Skip to content

Commit

Permalink
deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0Louis committed Feb 6, 2023
1 parent fe99fb7 commit a79651e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
6 changes: 4 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ fs_permissions = [
[rpc_endpoints]
avalanche = "https://api.avax.network/ext/bc/C/rpc"
fuji = "https://api.avax-test.network/ext/bc/C/rpc"
arbitrum_one = "https://arb1.arbitrum.io/rpc"
arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc"

[etherscan]
arbitrum_one_goerli = { url = "https://api-goerli.arbiscan.io/api", key = "${ARBISCAN_KEY}", chain = "arbitrum-goerli" }
arbitrum_one = { url = "https://api.arbiscan.io/api", key = "${ARBISCAN_KEY}", chain = "arbitrum" }
arbitrum_one_goerli = { url = "https://api-goerli.arbiscan.io/api", key = "${ARBISCAN_API_KEY}", chain = "arbitrum-goerli" }
arbitrum_one = { url = "https://api.arbiscan.io/api", key = "${ARBISCAN_API_KEY}", chain = "arbitrum" }
avalanche = { key = "${SNOWTRACE_API_KEY}", chain = "avalanche" }
fuji = { key = "${SNOWTRACE_API_KEY}", chain = "fuji" }

Expand Down
41 changes: 41 additions & 0 deletions script/deployment/arbigoerli/Rewarder.deploy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "forge-std/Script.sol";
import "openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol";
import "openzeppelin/proxy/transparent/ProxyAdmin.sol";

import "../../../src/Rewarder.sol";

contract RewarderDeployer is Script {
function run() public returns (address, address, address) {
vm.createSelectFork(stdChains["abitrum_one_goerli"].rpcUrl);

uint256 deployerPrivateKey = vm.envUint("DEPLOY_PRIVATE_KEY");

/**
* Start broadcasting the transaction to the network.
*/
vm.startBroadcast(deployerPrivateKey);

ProxyAdmin admin = new ProxyAdmin();

Rewarder implementation = new Rewarder();

TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
address(implementation),
address(admin),
""
);

Rewarder(payable(address(proxy))).initialize(30 days);

vm.stopBroadcast();
/**
* Stop broadcasting the transaction to the network.
*/

return (address(proxy), address(implementation), address(admin));
}
}
6 changes: 3 additions & 3 deletions script/deployment/fuji/Rewarder.upgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import "../../../src/Rewarder.sol";
contract RewarderUpgrader is Script {
IVBS public constant vbs = IVBS(0xFFC08538077a0455E0F4077823b1A0E3e18Faf0b);

ProxyAdmin public constant admin = ProxyAdmin(0x46709dbc09656292B27ad91EE2c5d324270D3387);
ProxyAdmin public constant admin = ProxyAdmin(0x65F3c037Ee4C142f4B60434a5f166EAfA06D458E);

TransparentUpgradeableProxy public constant proxy =
TransparentUpgradeableProxy(payable(0x1D336E165CbA662fa49B935fFdD7362C09Cc93ec));
TransparentUpgradeableProxy(payable(0x3e031f1486a27c997e85C5a2af2638EE3A4C28a1));

function run() public returns (address) {
vm.createSelectFork(stdChains["fuji"].rpcUrl, 17_891_593);
vm.createSelectFork(stdChains["fuji"].rpcUrl);

uint256 deployerPrivateKey = vm.envUint("DEPLOY_PRIVATE_KEY");

Expand Down

0 comments on commit a79651e

Please sign in to comment.