-
Notifications
You must be signed in to change notification settings - Fork 177
[Stellar] security contact as contract metadata #679
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
61
commits into
OpenZeppelin:master
Choose a base branch
from
CoveMB:stellar-security-contact
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 1 commit
Commits
Show all changes
61 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 acc5e6e
Merge remote-tracking branch 'upstream/master'
CoveMB e3b74c8
Merge remote-tracking branch 'upstream/master'
CoveMB 16ba867
Merge remote-tracking branch 'upstream/master'
CoveMB 10442ac
Merge remote-tracking branch 'upstream/master'
CoveMB f3d5bea
Merge remote-tracking branch 'upstream/master'
CoveMB 4427128
Merge remote-tracking branch 'upstream/master'
CoveMB e4734df
Merge remote-tracking branch 'upstream/master'
CoveMB 52bd1e0
Merge remote-tracking branch 'upstream/master'
CoveMB 0de594f
Merge branch 'master' of github.com:CoveMB/contracts-wizard
CoveMB 5bac310
Merge remote-tracking branch 'upstream/master'
CoveMB 63a50d5
Merge remote-tracking branch 'upstream/master'
CoveMB a10f142
Merge remote-tracking branch 'upstream/master'
CoveMB 8a4840e
Merge remote-tracking branch 'upstream/master'
CoveMB c8bc5cf
Merge remote-tracking branch 'upstream/master'
CoveMB 46ed7c0
Merge remote-tracking branch 'upstream/master'
CoveMB 53ee786
Add stellar metadata
CoveMB 0091f40
Add metadata for stellar contract
CoveMB c5d0aa8
Revert info input label
CoveMB f994389
Rename for security_contact
CoveMB 8c207e6
Update .changeset/silent-bags-repair.md
CoveMB 7348fa1
Throw error on already set metadata key
CoveMB 37b9e33
Throw error on already set metadata key
CoveMB 389df3d
Merge branch 'master' into stellar-security-contact
CoveMB 80dd878
add tests
CoveMB 5132555
Merge branch 'stellar-security-contact' of github.com:CoveMB/contract…
CoveMB a7db183
Merge remote-tracking branch 'upstream/master' into stellar-security-…
CoveMB 40d3488
Merge branch 'master' into stellar-security-contact
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
Some comments aren't visible on the classic Files Changed page.
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ import test from 'ava'; | |
import type { BaseFunction, BaseTraitImplBlock } from './contract'; | ||
import { ContractBuilder } from './contract'; | ||
import { printContract } from './print'; | ||
import { setInfo } from './set-info'; | ||
|
||
test('contract basics', t => { | ||
const Foo = new ContractBuilder('Foo'); | ||
|
@@ -120,3 +121,10 @@ test('contract with multiple metadata and documentation', t => { | |
Foo.addDocumentation('Some documentation'); | ||
t.snapshot(printContract(Foo)); | ||
}); | ||
|
||
test('contract with setInfo', t => { | ||
const Foo = new ContractBuilder('Foo'); | ||
setInfo(Foo, { securityContact: '[email protected]', license: 'MIT' }); | ||
|
||
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 |
---|---|---|
|
@@ -206,3 +206,19 @@ Generated by [AVA](https://avajs.dev). | |
#[contract]␊ | ||
pub struct Foo;␊ | ||
` | ||
|
||
## contract with setInfo | ||
|
||
> Snapshot 1 | ||
|
||
`// SPDX-License-Identifier: MIT␊ | ||
// Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ | ||
#![no_std]␊ | ||
␊ | ||
use soroban_sdk::contractmeta;␊ | ||
␊ | ||
contractmeta!(key="security_contact", val="[email protected]");␊ | ||
␊ | ||
#[contract]␊ | ||
pub struct 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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Just one additional feedback: It would be better to do the
toByteArray(value)
sanitization in the caller such ascontract.ts
, so that the model's content is already sanitized before printing.For comparison,
contract.ts
also has atoIdentifier
call for a similar purpose when setting the contract name.