Skip to content

kethcode/social

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

The Social Contract

The Social Contract is a relationship map between addresses. Keys are hashed
and used to index the mapping. Values are stored raw for retrieval.

Anticipated Common Use Cases:
	set (self, self, 'profile:avatar', 'nftAddress,tokenId');
	get (contract, contract, 'keyList');

	set (contract, user, 'member', 'true');
	set (user, contract, 'member' 'true');
	isMutual (contract, user, 'member');

	approve (contract, 'reputation', true);
	canEdit (contract, user, 'reputation');
	set(user, contract, 'reputation', '100');	 from contract
	set(contract, user, 'reputation', '100');	 from contract

Function ToC:
	set(address _sender, address _recipient, string memory _key, string memory _value)
	get(address _sender, address _recipient, string memory _key) returns (string memory)
	isMutual( address _sender, address _recipient, string memory _key) returns (bool)
	approve(address _recipient, string memory _key, bool _value)
	canEdit(address _sender, address _recipient, string memory _key) returns (bool)

  Social
    Deployment
      โœ“ Should set the right owner
    Self Attestation
      โœ“ Should set and get correct value for self, on self
      โœ“ Should emit EdgeAdded
      โœ“ Should change value for self, on self
    Unilateral Attestation
      โœ“ Should set and get correct value for another address, on self
      โœ“ Should change value for another address, on self
      โœ“ Should fail to set value for self, on another address
    Bidirectional Attestation
      โœ“ Should set and confirm mutual attestation
      โœ“ Should emit EdgeAdded twice
      โœ“ Should not confirm mutual attestation on unilateral attestation
      โœ“ Should not confirm mutual attestation if a mutual attestation changes
    Unilateral Attestation with Approval
      โœ“ Should grant permission to a specific key
      โœ“ Should emit ApprovalChanged
      โœ“ Should fail to set value to a specific key on a remote address, without approval
      โœ“ Should set value to a specific key on a remote address, after approved
      โœ“ Should set value to a specific key on a remote address, if ApproveAll

ยท-------------------------|---------------------------|-------------|-----------------------------ยท
|   Solc version: 0.8.9   ยท  Optimizer enabled: true  ยท  Runs: 300  ยท  Block limit: 30000000 gas  โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Methods                                                                                        โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Contract  ยท  Method    ยท  Min        ยท  Max        ยท  Avg        ยท  # calls      ยท  usd (avg)  โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Social    ยท  approve   ยท      48259  ยท      48367  ยท      48340  ยท            4  ยท          -  โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Social    ยท  set       ยท      35672  ยท      56561  ยท      49464  ยท           22  ยท          -  โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Deployments            ยท                                         ยท  % of limit   ยท             โ”‚
ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท|ยทยทยทยทยทยทยทยทยทยทยทยทยทยท
|  Social                 ยท          -  ยท          -  ยท     579666  ยท        1.9 %  ยท          -  โ”‚
ยท-------------------------|-------------|-------------|-------------|---------------|-------------ยท

Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

npx hardhat help
npx hardhat test
GAS_REPORT=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published