-
Notifications
You must be signed in to change notification settings - Fork 72
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
few updates #159
few updates #159
Conversation
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.35 to 17.0.36. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…bs/sx-core into generalize_addresses
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.
All good except one test that got modified :)
# Generalized type used to represent addresses in Snapshot X. Eg Ethereum, Starknet, etc. | ||
struct Address: | ||
member value : felt | ||
end |
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.
Should this be called lib/address
? I find it odd to have a filename be general_address
and the actual object be Address
?
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.
hmm yeah its not ideal, just thought that people would assume its a Starknet address if its called address.cairo
.commit( | ||
getCommit(BigInt(space.address), BigInt(getSelectorFromName('vote')), proposeCalldata) | ||
); // Wrong selector | ||
.commit(getCommit(BigInt(space.address), PROPOSE_SELECTOR, proposeCalldata)); // Wrong selector |
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.
This was supposed to be VOTE_SELECTOR
, not PROPOSE_SELECTOR
I think (since the comment says "Wrong selector") ?
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.
The test was testing that revert case (ie authentication fails if the wrong hash is committed) - the comment is just referring to what I changed to cause it to fail.
let spaceAddress: bigint; | ||
let executionHash: string; | ||
let metadataUri: bigint[]; | ||
let proposerAccount: Account; | ||
let proposerAddress: string; | ||
let usedVotingStrategies1: bigint[]; | ||
let userVotingParamsAll1: bigint[][]; | ||
let executionStrategy: bigint; | ||
let executionParams: bigint[]; | ||
let ethBlockNumber: bigint; | ||
let proposeCalldata: bigint[]; | ||
|
||
// Additional parameters for voting | ||
let voterAccount: Account; | ||
let voterAddress: string; | ||
let proposalId: bigint; | ||
let choice: Choice; | ||
let usedVotingStrategies2: bigint[]; | ||
let userVotingParamsAll2: bigint[][]; | ||
let voteCalldata: bigint[]; | ||
|
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.
nice and tidy
Few updates. Got a bit carried away, will do on separate PRs next time
Allow handling of both Ethereum and Starknet addresses in the space contract and voting strategies.
Switched to a felt to uint256 function from cairo common
Fixed vulnerability in authenticators where the library function
execute
could be called directly.Added starknet.js deployment script for a space contract with a number of modules activated. Can call deployment script with
yarn deploy:goerli
.Deployment info in
./deployments/goerli1.json