Skip to content

Commit

Permalink
update readme, fee structure and allow only testnet via circle api
Browse files Browse the repository at this point in the history
  • Loading branch information
prettyirrelevant committed Aug 31, 2023
1 parent eb77b09 commit 619fb3a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ Here are a few ways you can get involved:
- **Spread the Word**: Help us reach more enthusiasts by sharing the project with your network. The more creators and collectors we bring together, the stronger our community becomes.
- **Feature Requests**: If you have ideas for new features or improvements, share them with us! We're excited to hear how we can enhance the marketplace to better serve the community.
- **Code Contributions**: Developers can contribute by submitting pull requests. Whether it's fixing bugs, optimizing code, or adding new functionalities, your code contributions are invaluable.
- **Bug Reports and Feedback**: If you encounter any issues or have suggestions for improvement, please open an issue on GitHub. Your feedback helps us maintain a high-quality marketplace experience.
- **Bug Reports and Feedback**: If you encounter any issues or have suggestions for improvement, please open an issue on GitHub.


## 👥 Team
<sup>[(Back to top)](#------------------------)</sup>

Meet the creative minds who brought this project to life:

| **Name** | **Role** | **GitHub** |
|---------------------|---------------------------------|-----------------------------------------------|
| Olayinka Ganiyu | Smart Contract Developer (LxLy) | [GitHub](https://github.com/Jaybee020) |
| Kester Atakere | Designer & Frontend Developer | [GitHub](https://github.com/codergon) |
| Tobiloba Emmanuel | Smart Contract Developer (CCTP) | [GitHub](https://github.com/Tee-py) |
| Isaac Adewumi | Backend Developer | [GitHub](https://github.com/prettyirrelevant) |
| **Name** | **Role** | **GitHub** |
|---------------------|--------------------------------|-----------------------------------------------|
| Olayinka Ganiyu | Smart Contract Engineer (LxLy) | [GitHub](https://github.com/Jaybee020) |
| Kester Atakere | Designer & Frontend Engineer | [GitHub](https://github.com/codergon) |
| Tobiloba Emmanuel | Smart Contract Engineer (CCTP) | [GitHub](https://github.com/Tee-py) |
| Isaac Adewumi | Backend Engineer | [GitHub](https://github.com/prettyirrelevant) |
1 change: 1 addition & 0 deletions backend/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ disable=raw-checker-failed,
broad-exception-caught,
abstract-method,
too-many-arguments,
line-too-long

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
7 changes: 5 additions & 2 deletions backend/bridgebloc/apps/conversions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ class TokenConversion(UUIDModel, TimestampedModel, models.Model):

@property
def actual_amount(self) -> Decimal:
max_fee = Decimal(20)
if self.conversion_type == ConversionMethod.CIRCLE_API:
return self.amount * Decimal('0.96')
fee_charged = min(Decimal(0.04) * self.amount, max_fee)
return self.amount - fee_charged

return self.amount * Decimal('0.97')
fee_charged = min(Decimal(0.03) * self.amount, max_fee)
return self.amount - fee_charged


class TokenConversionStep(UUIDModel, TimestampedModel, models.Model):
Expand Down
8 changes: 6 additions & 2 deletions backend/bridgebloc/apps/conversions/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
except ValueError as e:
raise serializers.ValidationError(str(e)) from e

# Only allow testnet for now since Circle Live API requires verification.
if source_chain.is_mainnet() or destination_chain.is_mainnet():
raise serializers.ValidationError('Only testnet network is supported via Circle API for now.')

if source_chain == destination_chain:
raise serializers.ValidationError('source_chain cannot be the same as destination_chain')

Expand Down Expand Up @@ -142,7 +146,7 @@ def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
attrs.update(info)
return attrs

def _validate_tx_receipt(
def _validate_tx_receipt( # pylint: disable=too-many-locals
self,
client: EVMClient,
receipt: TxReceipt,
Expand Down Expand Up @@ -212,7 +216,7 @@ def _validate_tx_receipt(
'message_bytes': found_message_sent_events[0].args.message.hex(),
'message_hash': Web3.keccak(found_message_sent_events[0].args.message).hex(),
'destination_address': to_checksum_address(bridge_deposit_received_event['recipient']),
'amount': usdc_token.convert_from_wei_to_token(bridge_deposit_received_event['amount']),
'amount': usdc_token.convert_from_wei_to_token(bridge_deposit_received_event['amount']), # type: ignore[union-attr] # noqa: E501
}


Expand Down
4 changes: 2 additions & 2 deletions backend/bridgebloc/apps/conversions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from decimal import Decimal

from eth_account import Account
from eth_utils import to_bytes
from eth_utils.conversions import to_bytes
from huey import crontab
from huey.contrib.djhuey import db_periodic_task, lock_task
from web3.types import TxParams
Expand Down Expand Up @@ -267,7 +267,7 @@ def cctp_send_token_to_recipient() -> None:
to_bytes(hexstr=step.metadata['message_bytes']),
to_bytes(hexstr=step.metadata['attestation']),
step.metadata['nonce'],
int(usdc_token.convert_from_token_to_wei(step.conversion.actual_amount)),
int(usdc_token.convert_from_token_to_wei(step.conversion.actual_amount)), # type: ignore[union-attr]
step.conversion.destination_token.address,
step.conversion.destination_address,
)
Expand Down
2 changes: 1 addition & 1 deletion backend/bridgebloc/services/attestation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from eth_typing import HexStr


class AttestationService:
class AttestationService: # pylint: disable=too-few-public-methods
def __init__(self, base_url: str) -> None:
self.base_url = base_url
self.session = requests.Session()
Expand Down
7 changes: 0 additions & 7 deletions backend/start.sh

This file was deleted.

0 comments on commit 619fb3a

Please sign in to comment.