Skip to content

Commit

Permalink
change openzeppelin version
Browse files Browse the repository at this point in the history
  • Loading branch information
WuEcho committed Dec 13, 2024
1 parent 11f4cea commit f989461
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 82 deletions.
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = v4.9.0
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
branch = v4.9.0
10 changes: 1 addition & 9 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,9 @@ $ anvil
### Deploy

```shell
$ forge script script/PrimusZKTLS.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Upgrade

```shell
$ forge script script/UpgradeZKTLS.s.sol --rpc-url <your_rpc_url> --private-key <your_private_key> --broadcast

```


### Cast

```shell
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IPrimusZkTLS.sol/interface.IPrimusZkTLS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IPrimusZKTLS
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/IPrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/IPrimusZKTLS.sol)

*Interface of PrimusZKTLS, which defines functions for handling attestations and related operations.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IPrimusZkTLS.sol/struct.AttNetworkRequest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AttNetworkRequest
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/IPrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/IPrimusZKTLS.sol)

*Structure for representing a network request send to jsk and related to the attestation.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AttNetworkResponseResolve
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/IPrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/IPrimusZKTLS.sol)

*Structure for resolving responses from a network request.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IPrimusZkTLS.sol/struct.Attestation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Attestation
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/IPrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/IPrimusZKTLS.sol)

*Structure representing an attestation, which is a signed statement of fact.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IPrimusZkTLS.sol/struct.Attestor.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Attestor
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/IPrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/IPrimusZKTLS.sol)

*Structure representing an attestor, who is responsible for signing the attestation.*

Expand Down
6 changes: 3 additions & 3 deletions docs/src/src/PrimusZkTLS.sol/contract.PrimusZkTLS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PrimusZKTLS
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/598ebb1789581520b0b29d02a686bfae9b7ffe60/src/PrimusZKTLS.sol)
[Git Source](https://github.com/primus-labs/zkTLS-contracts/blob/11f4cead3677496fd937372843f5c9fca4283fc1/src/PrimusZKTLS.sol)

**Inherits:**
OwnableUpgradeable, [IPrimusZKTLS](/src/IPrimusZKTLS.sol/interface.IPrimusZKTLS.md)
Expand Down Expand Up @@ -36,11 +36,11 @@ This function is called during the contract deployment.*
function initialize(address _owner) public initializer;
```

### setupDefaultAttestor
### _setupDefaultAttestor


```solidity
function setupDefaultAttestor(address defaultAddr) internal;
function _setupDefaultAttestor(address _defaultAddr) internal;
```

### setAttestor
Expand Down
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at 54b3f1
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
19 changes: 0 additions & 19 deletions script/Counter.s.sol

This file was deleted.

2 changes: 1 addition & 1 deletion script/PrimusZKTLS.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract DeployPrimusZKTLS is Script {
PrimusZKTLS logic = new PrimusZKTLS();

// 3. Deploy ProxyAdmin
ProxyAdmin proxyAdmin = new ProxyAdmin(deployerAddress);
ProxyAdmin proxyAdmin = new ProxyAdmin();

// 4. Prepare initialization data
bytes memory initializeData = abi.encodeWithSelector(
Expand Down
14 changes: 0 additions & 14 deletions src/Counter.sol

This file was deleted.

14 changes: 7 additions & 7 deletions src/PrimusZKTLS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ contract PrimusZKTLS is OwnableUpgradeable, IPrimusZKTLS {
* This function is called during the contract deployment.
*/
function initialize(address _owner) public initializer {
__Ownable_init(_owner);
setupDefaultAttestor(_owner);
__Ownable_init();
_setupDefaultAttestor(_owner);
}

function setupDefaultAttestor(address defaultAddr) internal {
require(defaultAddr != address(0), "Invalid address");
_attestorsMapping[defaultAddr] = Attestor({
attestorAddr: defaultAddr,
function _setupDefaultAttestor(address _defaultAddr) internal {
require(_defaultAddr != address(0), "Invalid address");
_attestorsMapping[_defaultAddr] = Attestor({
attestorAddr: _defaultAddr,
url: "https://primuslabs.xyz/"
});
_attestors.push(Attestor({
attestorAddr: defaultAddr,
attestorAddr: _defaultAddr,
url: "https://primuslabs.xyz/"
}));
}
Expand Down
24 changes: 0 additions & 24 deletions test/Counter.t.sol

This file was deleted.

0 comments on commit f989461

Please sign in to comment.