Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QSI_Groupe1
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lydia Tarmelit
QSI_Groupe1
Commits
dcccea79
Commit
dcccea79
authored
1 year ago
by
Joe El hajj
Browse files
Options
Downloads
Patches
Plain Diff
4 endpoints
parent
3e9bde6e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
contracts/AssociationRegistry.jsligo
+12
-12
12 additions, 12 deletions
contracts/AssociationRegistry.jsligo
with
13 additions
and
13 deletions
README.md
+
1
−
1
View file @
dcccea79
# QSI_Groupe1
# QSI_Groupe1
l'adresse du contrat: KT1
QTwmF2eptKss2FWbT1rHP5wCERL16kihQ
l'adresse du contrat: KT1
KDh3oWApHysHWdcDuFuNhk1WoVvJTtsDF
## Getting started
## Getting started
...
...
This diff is collapsed.
Click to expand it.
contracts/AssociationRegistry.jsligo
+
12
−
12
View file @
dcccea79
...
@@ -8,29 +8,30 @@ type storage = map<string, association>;
...
@@ -8,29 +8,30 @@ type storage = map<string, association>;
type return_ = [list<operation>, storage];
type return_ = [list<operation>, storage];
const myAssoAdmin = ("tz1aek2YDiM5xxqZwus1eyR3siiSNjmiJfFM" as address) ;
const registrationFeeInitial= 10
000000
mutez;
const registrationFeeInitial= 10
as
mutez;
// Register a new DAO
// Register a new DAO
@entry
@entry
const registerAssociation = (association: association, storage: storage): return_ => {
const registerAssociation = (association: association, storage: storage): return_ => {
//Addresse of MyAsso
let operations : list<operation> = list([]) ;
const ownerAddress = ("tz1dV9UkbS6uMuKjQy5Vs7FSptKz8LR28oFq" as address)
const receiver : contract<unit> =
const receiver : contract<unit> =
match (Tezos.get_contract_opt(
ownerAddress) as option<contract<unit>>
) {
match
(
(Tezos.get_contract_opt(
myAssoAdmin))
) {
when(Some(contract)): contract;
when(Some(contract)): contract;
when(None()): (failwith ("Not a contract") as contract<unit>)
when(None()): (failwith ("Not a contract") as contract<unit>)
}
}
// Check if walletAmount is present and greater than or equal to registrationFeeInitial
// Check if walletAmount is present and greater than or equal to registrationFeeInitial
//
if ((Tezos.get_
balance
())
>
registrationFeeInitial) {
if ((Tezos.get_
amount
())
!=
registrationFeeInitial) {
//
failwith("
Insufficient funds to register association
");
failwith("
The amount should be 10tez exactly
");
//
}
}
if(Some(Tezos.get_sender())== association.admin)
if(Some(Tezos.get_sender())== association.admin)
{
{
const payoutOperation : operation =Tezos.transaction(unit,
10000000mutez
,receiver);
const payoutOperation : operation =Tezos.transaction(unit,
registrationFeeInitial
,receiver);
const _
operations
: list <operation>
= list([payoutOperation]);
operations = list([payoutOperation]);
// Check if association already exists
// Check if association already exists
}
}
const existingAssociation = Map.mem(association.name, storage);
const existingAssociation = Map.mem(association.name, storage);
if (existingAssociation) {
if (existingAssociation) {
failwith("Association already registered");
failwith("Association already registered");
...
@@ -45,7 +46,7 @@ const receiver : contract<unit> =
...
@@ -45,7 +46,7 @@ const receiver : contract<unit> =
// Add new association to storage
// Add new association to storage
const updatedStorage: storage = Map.add(association.name, newAssociation, storage);
const updatedStorage: storage = Map.add(association.name, newAssociation, storage);
return [
list([])
, updatedStorage];
return [
operations
, updatedStorage];
}
}
...
@@ -83,4 +84,3 @@ const listDetailsAssociations = (associationName:string, stor: storage): associa
...
@@ -83,4 +84,3 @@ const listDetailsAssociations = (associationName:string, stor: storage): associa
@view
@view
const listAllAssociations = (_unused : unit,stor: storage): storage=> stor ;
const listAllAssociations = (_unused : unit,stor: storage): storage=> stor ;
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