-
Notifications
You must be signed in to change notification settings - Fork 167
Stylus add security contract field #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CoveMB
wants to merge
36
commits into
OpenZeppelin:master
Choose a base branch
from
CoveMB:stylus-add-security-contract-field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
27ebf04
Before running with prettier
CoveMB 7c7828e
After running with prettier
CoveMB ce5fcd3
Add consistent-type-imports rule
CoveMB 3cd0b59
Add lint step in ci action
CoveMB 31f0c78
resolve prettier conflict
CoveMB 365421b
After running with prettier
CoveMB cedaeaa
resolve prettier conflict
CoveMB 98bd8af
Add lint step in ci action
CoveMB a9098d0
resolve prettier conflict
CoveMB 6e9df26
resolve prettier conflict
CoveMB 574a739
Remove .vscode directory from Git tracking
CoveMB c0e9002
move linter action in it's own job
CoveMB 86c65dc
add lint note in readme
CoveMB a1111d3
Update .github/workflows/test.yml
CoveMB abbd5a4
Merge remote-tracking branch 'upstream/master'
CoveMB beffa34
Merge branch 'master' into master
ericglau d6bec2a
lint script files
CoveMB 315b775
Merge branch 'master' of github.com:CoveMB/contracts-wizard
CoveMB 6ed6e4f
Merge remote-tracking branch 'upstream/master'
CoveMB ea90cd1
Merge remote-tracking branch 'upstream/master'
CoveMB abf687a
Merge remote-tracking branch 'upstream/master'
CoveMB 426b62d
Merge remote-tracking branch 'upstream/master'
CoveMB ea25cc1
Merge remote-tracking branch 'upstream/master'
CoveMB 0911f87
Merge remote-tracking branch 'upstream/master'
CoveMB 4914083
Merge remote-tracking branch 'upstream/master'
CoveMB 5ce527f
Merge remote-tracking branch 'upstream/master'
CoveMB 03a32fc
Merge remote-tracking branch 'upstream/master'
CoveMB b3c0347
Merge remote-tracking branch 'upstream/master'
CoveMB 0a52a65
Merge remote-tracking branch 'upstream/master'
CoveMB 9e74342
Merge remote-tracking branch 'upstream/master'
CoveMB d727f51
Merge remote-tracking branch 'upstream/master'
CoveMB 60fb18f
Merge remote-tracking branch 'upstream/master'
CoveMB cbb7631
Merge remote-tracking branch 'upstream/master'
CoveMB 0f1267f
Merge remote-tracking branch 'upstream/master'
CoveMB e5ba7c6
Add securityContact to contract model, print function, ai agent and ui
CoveMB 524cb62
Add changeset
CoveMB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
--- | ||
'@openzeppelin/wizard-stylus': patch | ||
--- | ||
|
||
Add security contact in contract info |
This file contains hidden or 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 @@ import test from 'ava'; | |
import type { BaseFunction, BaseImplementedTrait } from './contract'; | ||
import { ContractBuilder } from './contract'; | ||
import { printContract } from './print'; | ||
import { TAG_SECURITY_CONTACT } from './set-info'; | ||
|
||
test('contract basics', t => { | ||
const Foo = new ContractBuilder('Foo'); | ||
|
@@ -77,3 +78,9 @@ test('contract with sorted traits', t => { | |
); | ||
t.snapshot(printContract(Foo)); | ||
}); | ||
|
||
test('contract with info', t => { | ||
const Foo = new ContractBuilder('Foo'); | ||
Foo.addDocumentationTag(TAG_SECURITY_CONTACT, '[email protected]'); | ||
t.snapshot(printContract(Foo)); | ||
}); |
This file contains hidden or 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 |
---|---|---|
|
@@ -167,3 +167,26 @@ Generated by [AVA](https://avajs.dev). | |
fn funcSpecial() {}␊ | ||
}␊ | ||
` | ||
|
||
## contract with info | ||
|
||
> Snapshot 1 | ||
|
||
`// SPDX-License-Identifier: MIT␊ | ||
// Compatible with OpenZeppelin Contracts for Stylus ^0.2.0-alpha.4␊ | ||
␊ | ||
#![cfg_attr(not(any(test, feature = "export-abi")), no_main)]␊ | ||
extern crate alloc;␊ | ||
␊ | ||
use stylus_sdk::prelude::*;␊ | ||
␊ | ||
/// @custom:security-contact [email protected]␊ | ||
␊ | ||
#[entrypoint]␊ | ||
#[storage]␊ | ||
struct Foo {}␊ | ||
␊ | ||
#[public]␊ | ||
#[inherit]␊ | ||
impl Foo {}␊ | ||
` |
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<script lang="ts"> | ||
import type { Info } from '@openzeppelin/wizard-stylus'; | ||
import { infoDefaults } from '@openzeppelin/wizard-stylus'; | ||
import HelpTooltip from '../common/HelpTooltip.svelte'; | ||
|
||
export let info: Info; | ||
</script> | ||
|
@@ -13,6 +14,16 @@ | |
</label> | ||
</h1> | ||
|
||
<label class="labeled-input"> | ||
<span class="flex justify-between pr-2"> | ||
Security Contact | ||
<HelpTooltip> | ||
Where people can contact you to report security issues. Will only be visible if contract metadata is verified. | ||
</HelpTooltip> | ||
</span> | ||
<input bind:value={info.securityContact} placeholder="[email protected]" /> | ||
</label> | ||
|
||
<label class="labeled-input"> | ||
<span>License</span> | ||
<input bind:value={info.license} placeholder={infoDefaults.license} /> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xNeshi @bidzyyys Would this be the appropriate placement for the security contact comment (and possibly other contract level comments)?