-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
5,129 additions
and
31 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
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,14 @@ | ||
name: Foundry | ||
|
||
on: push | ||
|
||
jobs: | ||
# we need to prepend _ to conform to 1155 standards | ||
_1155: | ||
uses: ./.github/workflows/foundry-base.yml | ||
with: | ||
package: "1155-contracts" | ||
protocol-rewards: | ||
uses: ./.github/workflows/foundry-base.yml | ||
with: | ||
package: "protocol-rewards" |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ jobs: | |
uses: ./.github/actions/setup_deps | ||
|
||
- name: Run prettier | ||
run: yarn run prettier:check | ||
run: yarn lint |
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 @@ | ||
auto-install-peers = true |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"repository": "[email protected]:ourzora/zora-contracts.git", | ||
"scripts": { | ||
"build": "turbo run build", | ||
"test": "turbo run test", | ||
"dev": "turbo run dev", | ||
"lint": "turbo run lint", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"" | ||
|
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
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
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,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.17; | ||
|
||
/* | ||
░░░░░░░░░░░░░░ | ||
░░▒▒░░░░░░░░░░░░░░░░░░░░ | ||
░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░ | ||
░░▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░ | ||
░▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░ | ||
░▓▓▓▒▒▒▒░░░░░░░░░░░░ ░░░░░░░░ | ||
░▓▓▓▒▒▒▒░░░░░░░░░░░░░░ ░░░░░░░░░░ | ||
░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░ | ||
░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░ | ||
░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░ | ||
░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░ | ||
░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░ | ||
░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ | ||
░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░ | ||
OURS TRULY, | ||
*/ | ||
|
||
interface Enjoy { } |
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,37 @@ | ||
[profile.default] | ||
auto_detect_solc = true | ||
fs_permissions = [{access = "read", path = "./addresses"}, {access = "read", path = "./package.json"}] | ||
fuzz_runs = 500 | ||
libs = ['_imagine', 'node_modules', 'script'] | ||
optimizer = true | ||
optimizer_runs = 500000 | ||
out = 'out' | ||
script = 'script' | ||
src = 'src' | ||
via_ir = true | ||
|
||
[profile.optimized] | ||
auto_detect_solc = true | ||
optimizer = true | ||
optimizer_runs = 500000 | ||
out = 'out' | ||
script = 'src' | ||
src = 'src' | ||
test = 'src' | ||
via_ir = true | ||
|
||
[fmt] | ||
bracket_spacing = true | ||
func_attrs_with_params_multiline = true | ||
int_types = "long" | ||
line_length = 120 | ||
quote_style = "double" | ||
tab_width = 4 | ||
|
||
[invariant] | ||
call_override = false | ||
depth = 20 | ||
fail_on_revert = true | ||
runs = 1000 | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
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,24 @@ | ||
{ | ||
"name": "@zoralabs/protocol-rewards", | ||
"version": "1.2.1", | ||
"repository": "https://github.com/ourzora/protocol-rewards.git", | ||
"license": "MIT", | ||
"files": [ | ||
"src/", | ||
"_imagine" | ||
], | ||
"scripts": { | ||
"build": "forge build", | ||
"test": "forge test", | ||
"prettier:check": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", | ||
"prettier": "prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'", | ||
"lint": "yarn run prettier" | ||
}, | ||
"dependencies": { | ||
"ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", | ||
"forge-std": "https://github.com/foundry-rs/forge-std#705263c95892a906d7af65f0f73ce8a4a0c80b80" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.3.2" | ||
} | ||
} |
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,2 @@ | ||
ds-test/=node_modules/ds-test/src/ | ||
forge-std/=node_modules/forge-std/src/ |
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,37 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import "./ScriptBase.sol"; | ||
|
||
import {console2} from "forge-std/console2.sol"; | ||
|
||
import {ProtocolRewards} from "../src/ProtocolRewards.sol"; | ||
|
||
contract DeployScript is ScriptBase { | ||
function run() public { | ||
vm.startBroadcast(deployer); | ||
|
||
// ProtocolRewards protocolRewards = new ProtocolRewards(); | ||
|
||
bytes memory creationCode = type(ProtocolRewards).creationCode; | ||
|
||
bytes32 salt = bytes32(0x0000000000000000000000000000000000000000668d7f9eb18e35000dbaaa0f); | ||
|
||
console2.log("creation code hash"); | ||
bytes32 creationCodeHash = keccak256(creationCode); | ||
console2.logBytes32(creationCodeHash); | ||
|
||
// Assert to ensure bytecode has not changed | ||
assert(bytes32(0xfa8c14fa41eb1f11f85062d699fe173e7ae3c1e988f0fa4c1846ac7948b6c471) == creationCodeHash); | ||
|
||
// Sanity check for address | ||
assert(IMMUTABLE_CREATE2_FACTORY.findCreate2Address(salt, creationCode) == address(0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B)); | ||
|
||
address result = IMMUTABLE_CREATE2_FACTORY.safeCreate2(salt, creationCode); | ||
|
||
console2.log("PROTOCOL REWARDS DEPLOYED:"); | ||
console2.logAddress(address(result)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
|
||
interface ImmutableCreate2Factory { | ||
function findCreate2Address(bytes32 salt, bytes memory initCode) external view returns (address deploymentAddress); | ||
|
||
function findCreate2AddressViaHash(bytes32 salt, bytes32 initCodeHash) external view returns (address deploymentAddress); | ||
|
||
function hasBeenDeployed(address deploymentAddress) external view returns (bool); | ||
|
||
function safeCreate2(bytes32 salt, bytes memory initializationCode) external payable returns (address deploymentAddress); | ||
} | ||
|
||
contract ScriptBase is Script { | ||
address deployer; | ||
|
||
ImmutableCreate2Factory constant IMMUTABLE_CREATE2_FACTORY = ImmutableCreate2Factory(0x0000000000FFe8B47B3e2130213B802212439497); | ||
|
||
function setUp() public { | ||
deployer = vm.envAddress("deployer"); | ||
} | ||
} |
Oops, something went wrong.