-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from Moonsong-Labs/erc20-and-erc721-proposals
Erc20 and erc721 proposals
- Loading branch information
Showing
11 changed files
with
747 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/env sh | ||
|
||
set -e | ||
set -o xtrace | ||
|
||
forge create --zksync \ | ||
--rpc-url http://localhost:3050 \ | ||
--private-key 0x87ce66d9f787696d21af61750c1c3310099f27fb7e7259a193a8c514293a7c0c \ | ||
--verify \ | ||
--verifier zksync \ | ||
--verifier-url http://localhost:3070/contract_verification \ | ||
src/PublicScopedBalanceErc20.sol:PublicScopedBalanceErc20 \ | ||
--constructor-args "PublicScopedBalanceErc20-posta" "PEB20P"; | ||
|
||
forge create --zksync \ | ||
--rpc-url http://localhost:3050 \ | ||
--private-key 0x87ce66d9f787696d21af61750c1c3310099f27fb7e7259a193a8c514293a7c0c \ | ||
--verify \ | ||
--verifier zksync \ | ||
--verifier-url http://localhost:3070/contract_verification \ | ||
src/ShareBalanceErc20.sol:ShareBalanceErc20 \ | ||
--constructor-args "ShareBalanceErc20-posta" "SB20P"; | ||
|
||
forge create --zksync \ | ||
--rpc-url http://localhost:3050 \ | ||
--private-key 0x87ce66d9f787696d21af61750c1c3310099f27fb7e7259a193a8c514293a7c0c \ | ||
--verify \ | ||
--verifier zksync \ | ||
--verifier-url http://localhost:3070/contract_verification \ | ||
src/ShareScopedBalanceErc20.sol:ShareScopedBalanceErc20 \ | ||
--constructor-args "ShareScopedBalanceErc20-posta" "SSBE20P"; | ||
|
||
|
||
forge create --zksync \ | ||
--rpc-url http://localhost:3050 \ | ||
--private-key 0x87ce66d9f787696d21af61750c1c3310099f27fb7e7259a193a8c514293a7c0c \ | ||
--verify \ | ||
--verifier zksync \ | ||
--verifier-url http://localhost:3070/contract_verification \ | ||
src/PublicSelectionErc721.sol:PublicSelectionErc721 \ | ||
--constructor-args "PublicSelectionErc721-posta" "PC721P"; | ||
|
||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
solc="0.8.24" | ||
|
||
[profile.default.zksync] | ||
zksolc = "1.5.6" |
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,106 @@ | ||
contracts: | ||
- address: <addr> | ||
methods: | ||
# ERC20 standard | ||
- signature: function totalSupply() public view returns (uint256) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function balanceOf(address account) public view returns (uint256) | ||
read: | ||
type: checkArgument | ||
argIndex: 0 | ||
write: | ||
type: closed | ||
- signature: function allowance(address owner, address spender) public view returns (uint256) | ||
read: | ||
type: oneOf | ||
rules: | ||
- type: checkArgument | ||
argIndex: 0 | ||
- type: checkArgument | ||
argIndex: 1 | ||
write: | ||
type: closed | ||
- signature: function approve(address spender, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transfer(address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transferFrom(address from, address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Open Zeppelion extended methods | ||
# | ||
- signature: function increaseAllowance(address spender, address addedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decreaseAllowance(address spender, address subtractedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function symbol() public view returns (string memory) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decimals() public view returns (uint8) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# IRC165 | ||
# | ||
- signature: function supportsInterface(bytes4 interfaceID) external view returns (bool) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Extended methods | ||
# | ||
- signature: function mint(address to, uint256 amount) public returns (bool) | ||
read: | ||
type: group | ||
groups: | ||
- admins | ||
write: | ||
type: group | ||
groups: | ||
- admins | ||
- signature: function publicThreshold(address target) public view returns (uint256, bool) | ||
read: | ||
type: public | ||
write: | ||
type: closed | ||
- signature: function changePublicThreshold(uint256 newThreshold) external | ||
read: | ||
type: public | ||
write: | ||
type: public |
111 changes: 111 additions & 0 deletions
111
permission-templates/erc20-share-balance-with-users.yaml
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,111 @@ | ||
contracts: | ||
- address: <addr> | ||
methods: | ||
# ERC20 standard | ||
- signature: function totalSupply() public view returns (uint256) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function balanceOf(address account) public view returns (uint256) | ||
read: | ||
type: checkArgument | ||
argIndex: 0 | ||
write: | ||
type: closed | ||
- signature: function allowance(address owner, address spender) public view returns (uint256) | ||
read: | ||
type: oneOf | ||
rules: | ||
- type: checkArgument | ||
argIndex: 0 | ||
- type: checkArgument | ||
argIndex: 1 | ||
write: | ||
type: closed | ||
- signature: function approve(address spender, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transfer(address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transferFrom(address from, address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Open Zeppelion extended methods | ||
# | ||
- signature: function increaseAllowance(address spender, address addedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decreaseAllowance(address spender, address subtractedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function symbol() public view returns (string memory) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decimals() public view returns (uint8) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# IRC165 | ||
# | ||
- signature: function supportsInterface(bytes4 interfaceID) external view returns (bool) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Extended methods | ||
# | ||
- signature: function mint(address to, uint256 amount) public returns (bool) | ||
read: | ||
type: group | ||
groups: | ||
- admins | ||
write: | ||
type: group | ||
groups: | ||
- admins | ||
- signature: function authorizedBalanceOf(address account) public view returns (uint256) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function shareBalanceWith(address reader) public | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function hideBalanceFrom(address reader) public | ||
read: | ||
type: public | ||
write: | ||
type: public |
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,111 @@ | ||
contracts: | ||
- address: <addr> | ||
methods: | ||
# ERC20 standard | ||
- signature: function totalSupply() public view returns (uint256) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function balanceOf(address account) public view returns (uint256) | ||
read: | ||
type: checkArgument | ||
argIndex: 0 | ||
write: | ||
type: closed | ||
- signature: function allowance(address owner, address spender) public view returns (uint256) | ||
read: | ||
type: oneOf | ||
rules: | ||
- type: checkArgument | ||
argIndex: 0 | ||
- type: checkArgument | ||
argIndex: 1 | ||
write: | ||
type: closed | ||
- signature: function approve(address spender, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transfer(address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function transferFrom(address from, address to, uint256 value) public returns (bool) | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Open Zeppelion extended methods | ||
# | ||
- signature: function increaseAllowance(address spender, address addedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decreaseAllowance(address spender, address subtractedValue) public | ||
# This doesn't leek information because we validate that current user | ||
# is msg.sender. | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function symbol() public view returns (string memory) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function decimals() public view returns (uint8) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# IRC165 | ||
# | ||
- signature: function supportsInterface(bytes4 interfaceID) external view returns (bool) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
|
||
# | ||
# Extended methods | ||
# | ||
- signature: function mint(address to, uint256 amount) public returns (bool) | ||
read: | ||
type: group | ||
groups: | ||
- admins | ||
write: | ||
type: group | ||
groups: | ||
- admins | ||
- signature: function authorizedBalanceOf(address account) public view returns (uint256) | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function shareBalanceWith(address reader, uint256 amount) public | ||
read: | ||
type: public | ||
write: | ||
type: public | ||
- signature: function hideBalanceFrom(address reader) public | ||
read: | ||
type: public | ||
write: | ||
type: public |
Oops, something went wrong.