Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QSI_Groupe2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lydia Tarmelit
QSI_Groupe2
Commits
f6233ab7
Commit
f6233ab7
authored
1 year ago
by
arnaud kaderi
Browse files
Options
Downloads
Patches
Plain Diff
deployment failed
parent
bc430dc6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ligo.json
+0
-0
0 additions, 0 deletions
ligo.json
src/contract.jsligo
+10
-22
10 additions, 22 deletions
src/contract.jsligo
src/contracts/fa2.jsligo
+3
-9
3 additions, 9 deletions
src/contracts/fa2.jsligo
src/parameter.jsligo
+7
-1
7 additions, 1 deletion
src/parameter.jsligo
with
20 additions
and
32 deletions
ligo.json
0 → 100644
+
0
−
0
View file @
f6233ab7
This diff is collapsed.
Click to expand it.
src/contract.jsligo
+
10
−
22
View file @
f6233ab7
...
...
@@ -8,7 +8,6 @@
#import "contracts/fa2.jsligo" "FA2"
export type vote = ["yay"] | ["nope"] | ["pass"];
// ===============================================================================================
...
...
@@ -50,13 +49,10 @@ export const create_proposal = (
@entry
export const make_vote = (
proposal_number: nat,
vote: vote,
storage: Storage.Types.t,
dao_contract_address: address,
): { operations: list<operation>, final_storage: Storage.Types.t } => {
let proposal = Preamble.retrieve_a_proposal(proposal_number, storage);
params: Parameter.Types.make_vote_params,
storage: Storage.Types.t
): result => {
let proposal = Preamble.retrieve_a_proposal(params.proposal_number, storage);
proposal
= Storage.Utils.add_signer_to_proposal(
proposal,
...
...
@@ -65,26 +61,16 @@ export const make_vote = (
);
// Récupérer le nombre de tokens du votant
const voterBalance = FA2.get_balance(Tezos.get_sender());
Conditions.insufficient_balance(voterBalance);
// Transférer les tokens vers le contrat de la DAO
const transferOperation =
FA2.transfer_tokens(
Tezos.get_sender(),
dao_contract_address,
voterBalance
);
const transferOperation = FA2.transfer_tokens(Tezos.get_sender());
const final_storage =
Storage.Utils.update_proposal(proposal_number, proposal, storage);
return
{ operations:
transferOperation, final_storage
: final_storage }
;
Storage.Utils.update_proposal(
params.
proposal_number, proposal, storage);
return
[
transferOperation, final_storage
]
;
};
// ===============================================================================================
/*
@entry
export const buy_token = (
buyer_address: address,
...
...
@@ -108,6 +94,7 @@ export const buy_token = (
// ===============================================================================================
// This function is now only used for tests, and will be removed once tests are rewritten
export const main = (action: Parameter.Types.t, store: Storage.Types.t): result =>
match(action) {
when (Create_proposal(p)):
...
...
@@ -115,3 +102,4 @@ export const main = (action: Parameter.Types.t, store: Storage.Types.t): result
when (Sign_proposal(p)):
sign_proposal(p, store)
}
*/
This diff is collapsed.
Click to expand it.
src/contracts/fa2.jsligo
+
3
−
9
View file @
f6233ab7
...
...
@@ -27,14 +27,8 @@ export const perform_operations = (proposal: Storage.Types.proposal): list<
} else return Constants.no_operation;
}
export const get_balance = (une_adresse : address): int => {
return 2 ;
}
export const get_balance = (une_adresse: address): int => { return 2; }
export const transfer_tokens = (
sender: address,
recipient: address,
amount: int
) : list<operation> => {
return list([]) ;
export const transfer_tokens = (sender: address,): list<operation> => {
return list([]);
};
This diff is collapsed.
Click to expand it.
src/parameter.jsligo
+
7
−
1
View file @
f6233ab7
...
...
@@ -5,8 +5,14 @@ export namespace Types {
target_fa2: address,
transfers: FA2.transfer
};
export type make_vote_params = {
proposal_number: nat;
vote: bool;
dao_contract_address: address;
};
export type proposal_number = nat;
export type t =
| ["Create_proposal", proposal_params]
| ["Sign_proposal", proposal_number];
| ["Sign_proposal", proposal_number]
| ["Make_vote", make_vote_params]
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment