![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@moraswap/permit2
Advanced tools
Permit2 introduces a low-overhead, next generation token approval/meta-tx system to make token approvals easier, more secure, and more consistent across applications.
Permit2
integrated contracts.Permit2 is the union of two contracts: AllowanceTransfer
and SignatureTransfer
.
The SignatureTransfer
contract handles all signature-based transfers, meaning that an allowance on the token is bypassed and permissions to the spender only last for the duration of the transaction that the one-time signature is spent.
The AllowanceTransfer
contract handles setting allowances on tokens, giving permissions to spenders on a specified amount for a specified duration of time. Any transfers that then happen through the AllowanceTransfer
contract will only succeed if the proper permissions have been set.
Before integrating contracts can request users’ tokens through Permit2
, users must approve the Permit2
contract through the specific token contract. To see a detailed technical reference, visit the Uniswap documentation site.
Permit2 uses viaIR compilation, so importing and deploying it in an integration for tests will require the integrating repository to also use viaIR compilation. This is often quite slow, so can be avoided using the precompiled DeployPermit2
utility:
import {DeployPermit2} from "permit2/test/utils/DeployPermit2.sol";
contract MyTest is DeployPermit2 {
address permit2;
function setUp() public {
permit2 = deployPermit2();
}
}
You will need a copy of Foundry installed before proceeding. See the installation guide for details.
git clone https://github.com/moraswap/permit2.git
cd permit2
forge install
forge fmt [--check]
# unit
forge test
# integration
source .env
FOUNDRY_PROFILE=integration forge test
forge snapshot
Run the command below. Remove --broadcast
, ---rpc-url
, --private-key
and --verify
options to test locally
forge script --broadcast --rpc-url <RPC-URL> --private-key <PRIVATE_KEY> --verify script/DeployPermit2.s.sol:DeployPermit2
Inspired by merklejerk's permit-everywhere contracts which introduce permit based approvals for all tokens regardless of EIP2612 support.
FAQs
Permit2 contract
The npm package @moraswap/permit2 receives a total of 3 weekly downloads. As such, @moraswap/permit2 popularity was classified as not popular.
We found that @moraswap/permit2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.